Skip to content
Snippets Groups Projects
Commit 6991b35b authored by Gabriel Ruschel's avatar Gabriel Ruschel
Browse files

Status code fixed

parent 2f232a18
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!53User route response code fix
Pipeline #
......@@ -23,7 +23,7 @@ function emailSyntax(email) {
userApp.post('/', (req, res, next) => {
if(req.body.email){
if(!emailSyntax(req.body.email)){
res.status = 400;
res.status(400);
res.json({success: false, msg: 'O email informado é inválido.'});
} else {
next();
......@@ -100,7 +100,7 @@ userApp.post('/', (req, res, next) => {
userApp.post('/authenticate', (req, res, next) => {
if (!req.body.email) {
res.status = 400;
res.status(400);
res.json({success: false, msg: 'O campo Email é obrigatório.'});
} else {
next();
......@@ -108,7 +108,7 @@ userApp.post('/authenticate', (req, res, next) => {
}, (req, res, next) => {
if (!req.body.password) {
res.status = 400;
res.status(400);
res.json({success: false, msg: 'O campo Senha é obrigatório.'});
} else {
next();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment