formSchema = z .object({ title: z.string().optional().nullable()})
formSchema = z .object({ title: z.string().optional().nullable()})
In my form if I clear the value of
bar
bar
it generates the following for
updatedData
updatedData
:
{ bar: undefined}
{ bar: undefined}
As a result
bar
bar
will be ignored in the Prisma update and so it doesn't clear to null.
What's best practise here?: 1. Do I need to find a way to get Zod to generate null for empty fields (I've tried) 2. Or do I need to convert fields that are undefined to null in the