mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
id type fix
This commit is contained in:
@@ -3,7 +3,7 @@ import prisma from "@/app/prisma";
|
||||
import { z } from "zod/v4";
|
||||
|
||||
const schema = z.object({
|
||||
id: z.string(),
|
||||
id: z.number(),
|
||||
siteId: z.number(),
|
||||
name: z.string().min(2),
|
||||
ipv4Subnet: z.string().optional(),
|
||||
@@ -17,7 +17,7 @@ export async function POST(request: NextRequest) {
|
||||
try {
|
||||
const network = await prisma.network.create({
|
||||
data: {
|
||||
siteId: Number(body.siteId),
|
||||
siteId: body.siteId,
|
||||
name: body.name,
|
||||
ipv4Subnet: body.ipv4Subnet,
|
||||
ipv6Subnet: body.ipv6Subnet,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
export interface Site {
|
||||
id: string;
|
||||
id: number;
|
||||
name: string;
|
||||
description?: string;
|
||||
networks: Network[];
|
||||
}
|
||||
|
||||
export interface Network {
|
||||
id: string;
|
||||
siteId: string;
|
||||
id: number;
|
||||
siteId: number;
|
||||
name: string;
|
||||
ipv4Subnet?: string;
|
||||
ipv6Subnet?: string;
|
||||
|
||||
@@ -8,7 +8,7 @@ import { PlusCircle, Network as NetworkIcon, Globe, Wifi } from "lucide-react";
|
||||
|
||||
interface AddNetworkProps {
|
||||
onNetworkAdded?: () => void;
|
||||
siteId: string;
|
||||
siteId: number;
|
||||
}
|
||||
|
||||
export default function AddNetwork({ onNetworkAdded, siteId }: AddNetworkProps) {
|
||||
@@ -22,7 +22,7 @@ export default function AddNetwork({ onNetworkAdded, siteId }: AddNetworkProps)
|
||||
|
||||
const handleAddNetwork = async () => {
|
||||
const response = addNetwork({
|
||||
id: "0",
|
||||
id: 0,
|
||||
siteId,
|
||||
name,
|
||||
ipv4Subnet,
|
||||
|
||||
@@ -9,7 +9,7 @@ import { PencilLine, Network as NetworkIcon, Globe, Wifi } from "lucide-react";
|
||||
|
||||
interface EditNetworkProps {
|
||||
onNetworkEdited?: () => void;
|
||||
siteId: string;
|
||||
siteId: number;
|
||||
network: Network;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user