'Can not delete or update error in postman express mongoose
Solution 1:[1]
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
Solution 2:[2]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | tuphamdev96 |
| Solution 2 | Haithem SMIRI |

here is my code