Created
October 3, 2019 07:52
-
-
Save thjc/27e6d7458dd13045cf40206eb92ab3ae to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // make sure we return the updated person, with tags fully populated | |
| return Person.findOne({ _id: userID }).populate('tags').lean().exec((_err, got) => { | |
| if (!got) { // person does not exist | |
| return res.status(404).send({ error: 'person not found' }) | |
| } | |
| req.crudify.result = got | |
| next() | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment