Advertisement
Jenderal92

Untitled

Jul 22nd, 2022
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. exports.findOne = (req, res) => {
  2. Category.findById(req.params.categoryId)
  3. .then(category => {
  4. if(!category) {
  5. return res.status(404).send({
  6. message: "Category does not exist"
  7. });
  8. }
  9. res.send(category);
  10. }).catch(err => {
  11. return res.status(500).send({
  12. message: "Something went wrong."
  13. });
  14. });
  15. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement