diff --git a/server/api/clients.post.ts b/server/api/clients.post.ts index 97df465..486e35b 100644 --- a/server/api/clients.post.ts +++ b/server/api/clients.post.ts @@ -28,10 +28,10 @@ export function checkIsClient( }); } - if (!(typeof value.name === "string" || value.name === null || (!patch && value.name === undefined))) errors.set("name", "is not string or null"); - if (!(typeof value.address === "string" || value.address === null || (!patch && value.address === undefined))) errors.set("address", "is not string or null"); - if (!(typeof value.phone === "string" || value.phone === null || (!patch && value.phone === undefined))) errors.set("phone", "is not string or null"); - if (!(typeof value.email === "string" || value.email === null || (!patch && value.email === undefined))) errors.set("email", "is not string or null"); + if (!(typeof value.name === "string" || value.name === null || (patch && value.name === undefined))) errors.set("name", "is not string or null"); + if (!(typeof value.address === "string" || value.address === null || (patch && value.address === undefined))) errors.set("address", "is not string or null"); + if (!(typeof value.phone === "string" || value.phone === null || (patch && value.phone === undefined))) errors.set("phone", "is not string or null"); + if (!(typeof value.email === "string" || value.email === null || (patch && value.email === undefined))) errors.set("email", "is not string or null"); for (const i in value as Partial>) if (!clientKeys.includes(i)) errors.set(i, `excessive property`);