I have been learning reactjs for front-end and springboot for back-end. I can say its such a nice experience
Now i want to update my database row using axios from my front-end , That is a bit challenging for me as i have tried axios.post and axios.patch but still cant get it working. Would really appreciate yoâall 's help. Below is the current code that am working on which is not giving me what i want
What do you mean by your code ânot giving [you] what [you] wantâ? Is it doing anything at all or just resulting in errors (please include any error messages).
Also, have you tested your API to work without using axios?
The API canât be working perfectly and not doing what you want at the same timeâyou need to be more specific about your problem and help people to help you: error messages, what you have tried, what doesnât work, what works⌠etc.
Are you able to read from the API (I assume you can)?
As I said in the previous post, have you tested your API without using axios?
Are you actually using developer tools and inspecting the console when you say âno errorsâ?
Have you tried console.log()ing the response returned by axios?
Do you have access to the server? And if so:
Is the server receiving your axios.post() and/or axios.pach() calls?
Does the server actually accept the PATCH HTTP method?
If the requests are received have you tried debugging by checking if the code that you expect to execute do in fact execute?
You have to look at you browserâs console if the request is not being made. Plus, from the screenshot, the problem is with your server-side code. Could you make Postman requests, to see if the API is working?
It doesnât look like youâre sending any data that the user may have entered. the url query as is just sends the string msisdn.
Iâm not familiar with axios.patch, but you may need to specify the data in a param block. Take a look at this issue, there are a number of comments showing required syntax.