You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried running the code provided to create a user registration feature, but I'm facing a 500 Axios Error. I've confirmed through Postman and Swagger that data is received correctly. I don't see any issues in the backend code. Could there be any problems with the code above?
I'm receiving the user ID, password, and email via input tags and using them with useForm like {...register("id")}. I've also debugged it by logging each value, such as console.log(id), and everything seems to be receiving the data correctly.
I've been stuck on this for days and it's frustrating.
Example Code
constonSubmit=(formData)=>{axios.post("http://example.com/api/auth/sign-up",{id: formData.id,password: formData.password,email: formData.email,},{headers: {"Content-Type": "application/json",},}).then((response)=>{if(response.status!==200){thrownewError("Network response was not ok");}returnresponse.data;}).then((result)=>{console.log("result :",result);navigate("../login");}).catch((error)=>console.error("error:",error));};
Expected behavior
No response
Axios Version
1.6.7
Adapter Version
HTTP
Browser
Chrome
Browser Version
No response
Node.js Version
No response
OS
No response
Additional Library Versions
React 18.2.0
axios : ^1.6.7
swagger-ui:5.12.0
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered:
Thank you for answering my message :)
I was making a membership with useForm and not useState, but this is a problem caused by forgetting the existence of a function called watch for a while. The problem seems to have been purely my problem, not the backend problem.
Describe the issue
I've tried running the code provided to create a user registration feature, but I'm facing a 500 Axios Error. I've confirmed through Postman and Swagger that data is received correctly. I don't see any issues in the backend code. Could there be any problems with the code above?
I'm receiving the user ID, password, and email via input tags and using them with useForm like {...register("id")}. I've also debugged it by logging each value, such as console.log(id), and everything seems to be receiving the data correctly.
I've been stuck on this for days and it's frustrating.
Example Code
Expected behavior
No response
Axios Version
1.6.7
Adapter Version
HTTP
Browser
Chrome
Browser Version
No response
Node.js Version
No response
OS
No response
Additional Library Versions
React 18.2.0 axios : ^1.6.7 swagger-ui:5.12.0
Additional context/Screenshots
No response
The text was updated successfully, but these errors were encountered: