From 13ae773868a6b2960dcb5ccc59cb937df80fc2ee Mon Sep 17 00:00:00 2001 From: alannnc Date: Wed, 27 Apr 2022 15:21:18 -0600 Subject: [PATCH] Fix book event form schema validation (#2633) --- apps/web/components/booking/pages/BookingPage.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/web/components/booking/pages/BookingPage.tsx b/apps/web/components/booking/pages/BookingPage.tsx index ab686b28..0e23fa54 100644 --- a/apps/web/components/booking/pages/BookingPage.tsx +++ b/apps/web/components/booking/pages/BookingPage.tsx @@ -197,14 +197,16 @@ const BookingPage = ({ }; }; - const bookingFormSchema = z.object({ - name: z.string().min(1), - email: z.string().email(), - }); + const bookingFormSchema = z + .object({ + name: z.string().min(1), + email: z.string().email(), + }) + .passthrough(); const bookingForm = useForm({ defaultValues: defaultValues(), - resolver: zodResolver(bookingFormSchema), // Since this isnt set to strict we only validate the fields in the schema + resolver: zodResolver(bookingFormSchema), // Since this isn't set to strict we only validate the fields in the schema }); const selectedLocation = useWatch({