From eda8d0233a2126e6b7cd2c6d11bdaab4ea4ce604 Mon Sep 17 00:00:00 2001 From: Hager Eldakroury Date: Thu, 15 Jul 2021 01:05:35 +0200 Subject: [PATCH] fix: Correct erros status --- auth/src/routes/signup.ts | 4 +++- meetings/src/routes/new.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/auth/src/routes/signup.ts b/auth/src/routes/signup.ts index 750587d..892fc7e 100644 --- a/auth/src/routes/signup.ts +++ b/auth/src/routes/signup.ts @@ -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; diff --git a/meetings/src/routes/new.ts b/meetings/src/routes/new.ts index 3aa5e64..6f4ae71 100644 --- a/meetings/src/routes/new.ts +++ b/meetings/src/routes/new.ts @@ -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;