thomasmacfarlaine
TTCTheo's Typesafe Cult
•Created by thomasmacfarlaine on 3/17/2023 in #questions
How does one use prisma enums with zod when creating a new "post".
Yes, it's not the best
9 replies
TTCTheo's Typesafe Cult
•Created by thomasmacfarlaine on 3/17/2023 in #questions
How does one use prisma enums with zod when creating a new "post".
However I like your approach as it seems straight forward. I am sure there is a neat way to do it.
9 replies
TTCTheo's Typesafe Cult
•Created by thomasmacfarlaine on 3/17/2023 in #questions
How does one use prisma enums with zod when creating a new "post".
Thanks - ideally I would like to not have to duplicate the types. I am exploring using https://www.npmjs.com/package/zod-prisma
9 replies
TTCTheo's Typesafe Cult
•Created by thomasmacfarlaine on 3/17/2023 in #questions
How does one use prisma enums with zod when creating a new "post".
I have tried this as well:
const tags = z.nativeEnum(Tag).array();
type Tags = z.infer<typeof tags>;
9 replies