typicode / json-server

Get a full fake REST API with zero coding in less than 30 seconds (seriously)
Other
71.87k stars 6.93k forks source link

Newly added data is not recognized when trying to update it seconds later #1561

Open Aayush-683 opened 3 weeks ago

Aayush-683 commented 3 weeks ago

When you use the POST method to add some new data to an endpoint. Later, when i try to update the data using either PUT or PATCH method, it simply does not exist, visiting the URL says "Not Found" but the object is shown in the total list on the endpoint. (Refer to the images attached below) image image image image

Aayush-683 commented 3 weeks ago

I think this is because the new object's id is not being saved as a String, causing it to not recognize it. Restarting the server fixes the id and converts it into a String