fix(user): PUT user retricted path errors are 401, not 500
This commit is contained in:
@@ -189,8 +189,8 @@ api.update = function(req, res, next) {
|
||||
return true;
|
||||
});
|
||||
user.save(function(err) {
|
||||
if (!_.isEmpty(errors)) return res.json(500, {err: errors});
|
||||
if (err) {return res.json(500, {err: err})}
|
||||
if (!_.isEmpty(errors)) return res.json(401, {err: errors});
|
||||
if (err) return res.json(500, {err: err});
|
||||
res.json(200, user);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user