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";
|
import { z } from "zod/v4";
|
||||||
|
|
||||||
const schema = z.object({
|
const schema = z.object({
|
||||||
id: z.string(),
|
id: z.number(),
|
||||||
siteId: z.number(),
|
siteId: z.number(),
|
||||||
name: z.string().min(2),
|
name: z.string().min(2),
|
||||||
ipv4Subnet: z.string().optional(),
|
ipv4Subnet: z.string().optional(),
|
||||||
@@ -17,7 +17,7 @@ export async function POST(request: NextRequest) {
|
|||||||
try {
|
try {
|
||||||
const network = await prisma.network.create({
|
const network = await prisma.network.create({
|
||||||
data: {
|
data: {
|
||||||
siteId: Number(body.siteId),
|
siteId: body.siteId,
|
||||||
name: body.name,
|
name: body.name,
|
||||||
ipv4Subnet: body.ipv4Subnet,
|
ipv4Subnet: body.ipv4Subnet,
|
||||||
ipv6Subnet: body.ipv6Subnet,
|
ipv6Subnet: body.ipv6Subnet,
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
export interface Site {
|
export interface Site {
|
||||||
id: string;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
networks: Network[];
|
networks: Network[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Network {
|
export interface Network {
|
||||||
id: string;
|
id: number;
|
||||||
siteId: string;
|
siteId: number;
|
||||||
name: string;
|
name: string;
|
||||||
ipv4Subnet?: string;
|
ipv4Subnet?: string;
|
||||||
ipv6Subnet?: string;
|
ipv6Subnet?: string;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { PlusCircle, Network as NetworkIcon, Globe, Wifi } from "lucide-react";
|
|||||||
|
|
||||||
interface AddNetworkProps {
|
interface AddNetworkProps {
|
||||||
onNetworkAdded?: () => void;
|
onNetworkAdded?: () => void;
|
||||||
siteId: string;
|
siteId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function AddNetwork({ onNetworkAdded, siteId }: AddNetworkProps) {
|
export default function AddNetwork({ onNetworkAdded, siteId }: AddNetworkProps) {
|
||||||
@@ -22,7 +22,7 @@ export default function AddNetwork({ onNetworkAdded, siteId }: AddNetworkProps)
|
|||||||
|
|
||||||
const handleAddNetwork = async () => {
|
const handleAddNetwork = async () => {
|
||||||
const response = addNetwork({
|
const response = addNetwork({
|
||||||
id: "0",
|
id: 0,
|
||||||
siteId,
|
siteId,
|
||||||
name,
|
name,
|
||||||
ipv4Subnet,
|
ipv4Subnet,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { PencilLine, Network as NetworkIcon, Globe, Wifi } from "lucide-react";
|
|||||||
|
|
||||||
interface EditNetworkProps {
|
interface EditNetworkProps {
|
||||||
onNetworkEdited?: () => void;
|
onNetworkEdited?: () => void;
|
||||||
siteId: string;
|
siteId: number;
|
||||||
network: Network;
|
network: Network;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user