Fix book event form schema validation (#2633)
This commit is contained in:
parent
73e3e4e226
commit
e76fafdccf
1 changed files with 7 additions and 5 deletions
|
@ -197,14 +197,16 @@ const BookingPage = ({
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const bookingFormSchema = z.object({
|
const bookingFormSchema = z
|
||||||
name: z.string().min(1),
|
.object({
|
||||||
email: z.string().email(),
|
name: z.string().min(1),
|
||||||
});
|
email: z.string().email(),
|
||||||
|
})
|
||||||
|
.passthrough();
|
||||||
|
|
||||||
const bookingForm = useForm<BookingFormValues>({
|
const bookingForm = useForm<BookingFormValues>({
|
||||||
defaultValues: defaultValues(),
|
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({
|
const selectedLocation = useWatch({
|
||||||
|
|
Loading…
Reference in a new issue