Closed r17x closed 4 years ago
Hey there, the request looks about right with the type state
. Could you explain what part of the request
payload is wrong? The type of userId?
@fakenickels yes, the type of userId
it's wrong.
(first, render the form) --> userId is 0 --> user change and put 2 --> userId is "2"
I'm expect userId
it's int
before request to the API.
I see, the ReForm usage and types are correct to me! Probably it is getting turned into string from the encode you are using https://github.com/ri7nz/reform-reproduce/blob/master/src/Form.re#L126. Have you tried debugging the encode function?
@fakenickels But, maybe you can check at this line https://github.com/ri7nz/reform-reproduce/blob/master/src/Form.re#L95
~for the encode, I will be check again & give it feedback, soon.~
I have been check the encode I'm using This is an example
And this is an update for test the encode https://github.com/ri7nz/reform-reproduce/blob/master/src/Form.re#L108
@ri7nz It's not a reform problem it's the default behavior in every browser check this https://stackoverflow.com/questions/35791767/html-input-type-number-still-returning-a-string-when-accessed-from-javascript
Hello @fakenickels & @DCKT , thank you so much for response my issue. I'm close this is issue :+1:
@ri7nz any questions feel free to reach me out in Discord!
Hello, I'm use
Reform
.I have some problem with
type
in my form.I defined state of form like this:
But, when I want request to
API
, the payload ofrequest
it's different.I'm new corner, i didn't know how to solve this :smile: . Okay, this is an example project with my problem :smile: https://github.com/ri7nz/reform-reproduce
thank you