KryptXBSA / FormBuilder

UI based codegen tool to easily create Beautiful and Type safe @shadcn/ui forms.
https://formbuilder.kurdmake.com
MIT License
347 stars 40 forks source link

Incorrect values in the zod schema for min and max when the default values are edited. #3

Closed abyshekhar closed 6 months ago

abyshekhar commented 7 months ago

Create a new form and add a field and then change the default values for min and max and generate the code.

The generated code has value to the min function as string however it should be integer

const formSchema = z.object({"username":z.string().min("8").max(255),"password":z.string().min("10").max("256")}).strict()

In the snippet above the value 255 in max for username was populated by default however min value was edited to change from 1 to 8. Similarly the fields for min and max was changed for password field and it shows as string values which leads to syntax error in zod.

image

KryptXBSA commented 6 months ago

Thank you @abyshekhar for your contribution your PR has been merged into the refactor branch and soon will be merged in the main branch