Skip to content

Instantly share code, notes, and snippets.

@NMZivkovic
Created October 8, 2017 19:12
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 NMZivkovic/effa2f64ec9349252ed013f833b79ca1 to your computer and use it in GitHub Desktop.
Save NMZivkovic/effa2f64ec9349252ed013f833b79ca1 to your computer and use it in GitHub Desktop.
router.post('/updateUser', function(req, res, next) {
var user = new User(req.body);
User.update({_id : user.id}, user, function(err) {
if (err) {
console.log("not updated!");
res.status(400);
res.send();
}
console.log("updated!");
res.send({status: 'ok'});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment