sauceCtrl_getOneSauce

PHOTO EMBED

Wed Sep 08 2021 16:23:02 GMT+0000 (Coordinated Universal Time)

Saved by @devdave

exports.getOneSauce = (req, res, next) => {
  // mongoose model
  // targets _id = must be the same as the req param
  Sauce.findOne({ _id: req.params.id })
    .then((sauce) => res.status(200).json(sauce))
    .catch((error) => res.status(404).json({ error }));
};
content_copyCOPY