Commit 0ee54beb authored by pdg16's avatar pdg16
Browse files

change status code in edit responses pt2

parent 28e71486
Pipeline #20711 failed with stage
in 1 minute and 10 seconds
......@@ -368,13 +368,13 @@ userApp.put('/:id', passport.authenticate('bearer', { session: false }), checkAd
if (user.checkPassword(req.body.password)) {
user.password = req.body.newpassword;
} else {
res.statusCode = 500;
res.statusCode = 400;
return res.json({error: {
message: 'A senha atual está incorreta'
}});
}
} else {
res.statusCode = 500;
res.statusCode = 400;
return res.json({error: {
message: 'A nova senha é a mesma da senha atual'
}});
......@@ -384,7 +384,7 @@ userApp.put('/:id', passport.authenticate('bearer', { session: false }), checkAd
user.save(err => {
if(err) {
log.error(err);
res.statusCode = 500;
res.statusCode = 400;
return res.json({error: {
message: 'Email já cadastrado'
}});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment