Skip to content

Commit

Permalink
fix: Correct erros status
Browse files Browse the repository at this point in the history
  • Loading branch information
HagerDakroury committed Jul 14, 2021
1 parent c3179bc commit eda8d02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion auth/src/routes/signup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ router.post(
const errors = validationResult(req);

if (!errors.isEmpty()) {
return res.send(errors.array({ onlyFirstError: true })[0].msg);
return res
.status(400)
.send(errors.array({ onlyFirstError: true })[0].msg);
}

const { username, email, password, role } = req.body;
Expand Down
4 changes: 3 additions & 1 deletion meetings/src/routes/new.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ router.post(
const errors = validationResult(req);

if (!errors.isEmpty()) {
return res.send(errors.array({ onlyFirstError: true })[0].msg);
return res
.status(400)
.send(errors.array({ onlyFirstError: true })[0].msg);
}

let resV;
Expand Down

0 comments on commit eda8d02

Please sign in to comment.