Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
11 replies
mid

Zod with custom type

Need custom type validation in zod. help!!

type media_type = "all" | "movie" | "tv" | "person"


And use something like
getTrending: publicProcedure
    .input(
      z.object({
        media_type: z.custom() //need the media_type check here)
      })
    )
    .query(({ input }) => {
      return {
        ...input
      };
    }),
Was this page helpful?