'Can not delete or update error in postman express mongoose

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..



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