Skip to content

Commit

Permalink
missing return
Browse files Browse the repository at this point in the history
  • Loading branch information
ookamiiixd committed Dec 10, 2022
1 parent 982399f commit 3fb430b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middlewares/request-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { validationResult } from 'express-validator';

const validate: RequestHandler = (req, res, next) => {
const errors = validationResult(req);
if (!errors.isEmpty()) res.status(400).json({ errors: errors.array() });
if (!errors.isEmpty()) return res.status(400).json({ errors: errors.array() });
next();
};

Expand Down

0 comments on commit 3fb430b

Please sign in to comment.