Closed ledniy closed 10 months ago
@ledniy Yeah you're right, I've changed it to be passed to the backend as FormData instead of the JSON.stringify() method I was using before, this forces you to coerce types to make sure they are valid, eg z.number({ coerce: true }) for them to work, formData can be sent only as a string/file/blob type hence the reason for this. But in the docs it's outdated. Will change this
@ledniy I'll do you one better, there will be no need for you to coerce, I'll handle it inside the package
fixed with 3.2
Hi there, seems like there's an issue with numbers validation on the backend side, coz if I have z.number() in the schema it will correctly pass validation on the frontend but the action will return an error:
I believe that's a bug as in readme you saying it should be parsed as a number
But based on what I see in the
tryParseJSON
it will never parse it as a number, also in tests you expecting strings 🤷♂️