From ca21739009d6316f5026aebb32d394f7ee46cc76 Mon Sep 17 00:00:00 2001 From: Hery Nirintsoa Date: Sun, 8 Sep 2024 14:55:05 +0300 Subject: [PATCH] fix: email check error due to whitespace --- src/app/(dashboard)/invoice/client/client-dto.ts | 2 +- src/app/(dashboard)/invoice/client/components/client-save.tsx | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/(dashboard)/invoice/client/client-dto.ts b/src/app/(dashboard)/invoice/client/client-dto.ts index 6261512..6d51cd0 100644 --- a/src/app/(dashboard)/invoice/client/client-dto.ts +++ b/src/app/(dashboard)/invoice/client/client-dto.ts @@ -2,7 +2,7 @@ import { zd } from "@/lib/zod"; export const saveClientInputSchema = zd.object({ name: zd.string().min(1), - email: zd.string().email(), + email: zd.string().trim().email(), phone: zd.string().nullish(), address: zd.string().min(1), siren: zd.string().nullish(), diff --git a/src/app/(dashboard)/invoice/client/components/client-save.tsx b/src/app/(dashboard)/invoice/client/components/client-save.tsx index f770fde..756f543 100644 --- a/src/app/(dashboard)/invoice/client/components/client-save.tsx +++ b/src/app/(dashboard)/invoice/client/components/client-save.tsx @@ -37,7 +37,6 @@ export function ClientSave({ }, [client]); const reset = () => { - console.log({ client }); form.reset(client ? saveClientInputSchema.parse(client) : {}); };