Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.delete = (req, res) => {
- Category.findByIdAndRemove(req.params.categoryId)
- .then(category => {
- if(!category) {
- return res.status(404).send({
- message: "Category does not exist"
- });
- }
- res.send({message: "Category deleted successfully!"});
- }).catch(err => {
- return res.status(500).send({
- message: "Something went wrong"
- });
- });
- };
Advertisement
Add Comment
Please, Sign In to add comment