Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oprearocks/266e5aa87d2d5d90cb8b78169050dbbb to your computer and use it in GitHub Desktop.
Save oprearocks/266e5aa87d2d5d90cb8b78169050dbbb to your computer and use it in GitHub Desktop.
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