Fix book event form schema validation (#2633)

pull/2629/head^2
alannnc 2022-04-27 15:21:18 -06:00 committed by GitHub
parent 6f0fcc9d1b
commit 13ae773868
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -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<BookingFormValues>({
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({