Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In a Zod schena, when I add .optional().hint() to a z.number() it changes the type to string #52

Open
theG3n15 opened this issue Feb 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@theG3n15
Copy link
Contributor

theG3n15 commented Feb 8, 2024

Expected Behavior

I want to have a type number with the modifiers .optional() and .hint()

Current Behavior

I have a zod schema with a z.number().optional().hint() property. When I try to add a new object, it crashes this part, returning an error of "Expected number, recieved string"

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to admin panel
  2. Create an object with a z.number().optional().hint() propery
  3. Try to add a new object by filling that property input

Context (Environment)

  • Default setup
  • OS: Windows 11
  • Browser: Chrome
  • Environment: dev

Issue demo

Captura de pantalla 2024-02-08 152848

Captura de pantalla 2024-02-08 152908

@theG3n15 theG3n15 added the bug Something isn't working label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant