Patch request Error, json-server

Anyone can help me what is the problem of this: The get request is working using the user_num property as identifier and not the id. but when i use it in patch it returns 404 not found Get Request: axios.get('http://localhost:3000/users?user_num=US24-18') .then(function (response) { // handle success alert('sucess') console.log(response); }) .catch(function (error) { // handle error console.log(error); }) Patch: axios.patch('http://localhost:3000/users?user_num=US24-18', { userStatus: 'active' }) .then(function (response) { // handle success console.log(response); }) .catch(function (error) { // handle error console.log(error); });
3 Replies
ἔρως
ἔρως10mo ago
do you have a route in the server that accepts a PATCH request?
francis
francisOP10mo ago
the patch works if i use the id of the object like: "http://localhost:3000/users/1", but i want to use the user_num propety as identifier. each user_num property have unique value
ἔρως
ἔρως10mo ago
how do you handle it in the server?
Want results from more Discord servers?
Add your server