Input values aren’t saved to the database unless they are changed
I’m trying to create an edit profile page, and it mostly works. When I open the page, the text fields have the corresponding information from the database, and when I make changes and submit, the information is saved to the database.
Unable to connect with MongoDB Compass for a MERN stack project
I am currently working on the register page for a hospital appointment management system using MERN stack. However, I encountered a problem in setting up MongoDB to store the data. My current MongoDB Compass version is 1.43.4.
Trying to get a form to update a value but it isn’t updating in the database. I feel like my handleSubmit is missing something but I’m not sure what
I want to update the gender_interest value in my database. When I hit submit it reloads and returns a status 200 but the value in my database remains the same. I’m not sure if I’m missing something from const handleSubmit or event handling or if I need to add a use useEffect hook.
Why does this post method return an error 404 axios ? Could somebody help me solve this?
{ “message”: “Request failed with status code 404”, “name”: “AxiosError”, “stack”: “AxiosError: Request failed with status code 404n at settle (http://localhost:5000/node_modules/.vite/deps/axios.js?v=269784b8:1216:12)n at XMLHttpRequest.onloadend (http://localhost:5000/node_modules/.vite/deps/axios.js?v=269784b8:1562:7)n at Axios.request (http://localhost:5000/node_modules/.vite/deps/axios.js?v=269784b8:2078:41)”, “config”: { “transitional”: { “silentJSONParsing”: true, “forcedJSONParsing”: true, “clarifyTimeoutError”: false }, “adapter”: [ “xhr”, “http”, “fetch” ], “transformRequest”: [ null ], “transformResponse”: [ null ], “timeout”: 0, “xsrfCookieName”: […]
Why this post method returns 404 axios error . could somebody help me to sole this?
{
“message”: “Request failed with status code 404”,
“name”: “AxiosError”,
“stack”: “AxiosError: Request failed with status code 404n at settle (http://localhost:5000/node_modules/.vite/deps/axios.js?v=269784b8:1216:12)n at XMLHttpRequest.onloadend (http://localhost:5000/node_modules/.vite/deps/axios.js?v=269784b8:1562:7)n at Axios.request (http://localhost:5000/node_modules/.vite/deps/axios.js?v=269784b8:2078:41)”,
“config”: {
“transitional”: {
“silentJSONParsing”: true,
“forcedJSONParsing”: true,
“clarifyTimeoutError”: false
},
“adapter”: [
“xhr”,
“http”,
“fetch”
],
“transformRequest”: [
null
],
“transformResponse”: [
null
],
“timeout”: 0,
“xsrfCookieName”: “XSRF-TOKEN”,
“xsrfHeaderName”: “X-XSRF-TOKEN”,
“maxContentLength”: -1,
“maxBodyLength”: -1,
“env”: {},
“headers”: {
“Accept”: “application/json, text/plain, /“,
“Content-Type”: “application/json”
},
“method”: “post”,
“url”: “http://localhost:5000/signup”,
“data”: “{“email”:”[email protected]”,”password”:”123″,”confirmpassword”:”123″}”
},
“code”: “ERR_BAD_REQUEST”,
“status”: 404
}