SHARE
TWEET

Untitled

a guest Jun 19th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. exports.editUser = async function(req, res, next) {
  2.   try {
  3.     const user = await db.User.findByIdAndUpdate(req.params.id, req.body, {useFindAndModify: false});
  4.     return res.status('200').json(user);
  5.   }
  6.   catch(err) {
  7.     console.log(err);
  8.     return next({
  9.       status: 400,
  10.       message: 'User could not be updated or does not exist.'
  11.     });
  12.   }
  13. };
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top