sauceCtrl_getOneSauce
Wed Sep 08 2021 16:23:02 GMT+0000 (UTC)
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
Comments