From 5d080b5879cbded138f9eeba853190fae0978862 Mon Sep 17 00:00:00 2001 From: Leandro Di Lorenzo Date: Sat, 3 Oct 2020 14:51:29 -0300 Subject: [PATCH] :bug: fix /session error response as bad request --- src/api/session.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api/session.js b/src/api/session.js index 74fd6c9..a13b1bc 100644 --- a/src/api/session.js +++ b/src/api/session.js @@ -1,6 +1,6 @@ require('dotenv').config(); const { check, validationResult } = require('express-validator'); -const { BAD_REQUEST, NOT_FOUND } = require('http-status-codes').StatusCodes; +const { BAD_REQUEST } = require('http-status-codes').StatusCodes; const token = require('../lib/token'); const { User } = require('../../db/models'); @@ -19,7 +19,7 @@ const create = async (req, res) => { const errors = validationResult(req); if (!errors.isEmpty()) { - return res.status(NOT_FOUND).json({ + return res.status(BAD_REQUEST).json({ created: false, errors: errors.array().map(e => e.msg), });