iway1 / trpc-panel

MIT License
627 stars 43 forks source link

Support zod nativeEnum field (or allow free text entry) #82

Open paradoxloop opened 1 year ago

paradoxloop commented 1 year ago

Hi great library!

Would be great if it supported the zod nativeEnum field alongside the currently supported the enum field. Alternativly as a work around it could put a plain text field to allow for manual data entry. The current implementation just hides the field and makes the mutation unsubmitable through trpc-panel.

Example:

enum Fruits {
  Apple,
  Banana,
}

....publicProcedure.input(z.object({id: z.string.uuid(), fruit: z.nativeEnum(Fruits)}).mutation(.......

will show the id field but hide the fruit field.

dmatora commented 10 months ago

same issue here

Jonatthu commented 7 months ago

Anyway to get this fixed? It’s causing a lot of trouble:(

jimmyphan commented 7 months ago

Would love this to be fixed