Z
Zod2mo ago
Arthur

Arthur - tsexport const getServicesSchema = se...

export const getServicesSchema = serviceSchema
.omit({quantity: true, pinned: true})
.extend({ quantity: z.number(), pinned: z.stringbool().or(z.boolean()) })
.partial()
.required({userId: true});
export const getServicesSchema = serviceSchema
.omit({quantity: true, pinned: true})
.extend({ quantity: z.number(), pinned: z.stringbool().or(z.boolean()) })
.partial()
.required({userId: true});
I had to do this because I set a default value, but it should not be set everytime when I try to use the schema (using .safeParse()) Any easier way to do this?
2 Replies
Unknown User
Unknown User2mo ago
Message Not Public
Sign In & Join Server To View
Arthur
ArthurOP3w ago
Is there any update on this?

Did you find this page helpful?