Home > Software design >  Can not delete or update error in postman express mongoose
Can not delete or update error in postman express mongoose

Time:03-24

I have written a code to update and delete with json and testing with postman it shows like below enter image description herehere is my code

please give me a solution for this matter..

CodePudding user response:

the req.params. should be the same like you write it in the path ("../:id") so your code must be like this : let noticeId = req.params.id or you change the path like this : router.route('/deleteNotice/:noticeId') and keeping this : let noticeId = req.params.noticeId

CodePudding user response:

Could you show your routing

And after that, change your define noticeId to let noticeId = req.params.id

Because of you defined the route is /deleteNotice/:id with id is your params

  • Related