Open mil920 opened 5 months ago
if you wanna apply defaults I tend to do the following:
const EditFormt = (props: {vessel: any}) =>
<AutoForm
formSchema={vesselInsertSchema}
onSubmit={onSubmit}
values={props.vessel && vesselInsertSchema.parse(props.vessel)}
/>
Hi, I don't kown why i have a optional field in my zod schema when i put a default value for edit action. My field become required but i don't want that because it's filled by my model value or empty, so why it's required ? Am i doing something wrong ? Thanks