fix(user): PUT user retricted path errors are 401, not 500

This commit is contained in:
Tyler Renelle
2014-01-30 21:39:19 -07:00
parent 8e86fddc64
commit 0aec4caa78
+2 -2
View File
@@ -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);
});
};