this is pretty poorly written, no wonder you have trouble.
You should either post json, or do a form post, not both. the server put method does not support form posts, so if a file is included it will not work.
also, why a single space for nulls?
assuming the hook values are bound to form elements they would all be string, but your code uses them as others data types.
your code sets a space to for null numbers, but the server gets a binding error when this happens, as a space can not map to a number.
it looks like you are using an entity for a form post. bad design.
it looks like edit is react component, but components should not be async. the async calls should be in a useEffect() callback.