Skip to content

Instantly share code, notes, and snippets.

@ShivamTyagi12345
Last active August 10, 2022 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShivamTyagi12345/3803e5a901a856815f06a4e644a808a6 to your computer and use it in GitHub Desktop.
Save ShivamTyagi12345/3803e5a901a856815f06a4e644a808a6 to your computer and use it in GitHub Desktop.
This function displays the details of dog once the function "dog_details" is called
const dog_details = (req, res) => {
const id = req.params.id;
Dog.findById(id)
.then(result => {
res.render('details', { dog: result, title: 'Dog Details' });
})
.catch(err => {
console.log(err);
});
}
module.exports = {dog_details}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment