sending FormData to the backend
When forms have numeric or boolean data, they will be sent as strings to the backend. Just be aware that this is happening to do some work to turn them into the proper datatypes.
Or one solution is:
|
|
This way, there’s no need to iterate and check each key what datatype they should be. What was sent is what is received. Not sure if there’s a downside when doing this, do let me know!
I got confused by this when working on react forms. The data in this call:
|
|
Is not the same when it got to the Action
function.