Skip to content
Advertisement

Cannot Delete and getting 404 not found error in router.delete

In my application, i am passing the request param id in router.delete and communicating that with vuex service. While triggering action api is fired but getting 404 not found and there is not request payload as well.

Express route.delete

JavaScript

Vuex service

JavaScript

vuex actions

JavaScript

enter image description here

component action trigger

JavaScript

It is showing in api response

server.js

JavaScript

Advertisement

Answer

Since your api endpoint is this: '/favorites/:favoriteId', You have to app favoriteId at the end of the request url not in the body. so your request have to be like this:

JavaScript

}

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement