Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

Commit

Permalink
🐛 fix /session error response as bad request
Browse files Browse the repository at this point in the history
  • Loading branch information
laendoor committed Oct 3, 2020
1 parent c606277 commit 5d080b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/api/session.js
Original file line number Diff line number Diff line change
@@ -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');

Expand All @@ -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),
});
Expand Down

0 comments on commit 5d080b5

Please sign in to comment.