Created
June 9, 2017 22:38
-
-
Save oprearocks/266e5aa87d2d5d90cb8b78169050dbbb to your computer and use it in GitHub Desktop.
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
app.put('/user/:userId', (req, res) => { | |
User.update({ _id: req.params.userId }, $set: req.body.data, (updateFailedError) => { | |
if (updateFailedError) { | |
res | |
.status(500) | |
.json({ | |
errors: [updateFailedError] | |
}); | |
} | |
res | |
.status(204) | |
.json({ | |
success: true | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment