Created
July 22, 2021 15:44
-
-
Save burkeholland/efcf2bc7fd9a3d84ecd9756f83f97551 to your computer and use it in GitHub Desktop.
Sample Code For Hasan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.post('/pug/found', function(req, res, next){ | |
if(!req.body.user.email){ | |
return res.status(422).json({errors: {email: "can't be blank"}}); | |
} | |
const pug = new LostPug(req.body.pug); | |
return pug.save().then(function(){ | |
console.log(lostPug); | |
return res.json({pug: JSON.stingify(pug)}); // in the video, change the "stingify" to "stringify" | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment