aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/utils.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-19 09:43:01 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-19 09:43:01 +0200
commit8a02bd0433b7101c5ea36e87a4edb63204d2adec (patch)
treed7ab4b6164aef752c216bd2f22f8b3b270a724b8 /server/middlewares/validators/utils.ts
parent9fd540562c356cb54b98861d2d9e7d4fbfcd00e0 (diff)
downloadPeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.tar.gz
PeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.tar.zst
PeerTube-8a02bd0433b7101c5ea36e87a4edb63204d2adec.zip
Add pod list endpoint with pagination, sort...
Diffstat (limited to 'server/middlewares/validators/utils.ts')
-rw-r--r--server/middlewares/validators/utils.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/middlewares/validators/utils.ts b/server/middlewares/validators/utils.ts
index 8845f8399..ea107bbe8 100644
--- a/server/middlewares/validators/utils.ts
+++ b/server/middlewares/validators/utils.ts
@@ -3,12 +3,12 @@ import * as express from 'express'
3 3
4import { logger } from '../../helpers' 4import { logger } from '../../helpers'
5 5
6function checkErrors (req: express.Request, res: express.Response, next: express.NextFunction, statusCode = 400) { 6function checkErrors (req: express.Request, res: express.Response, next: express.NextFunction) {
7 const errors = validationResult(req) 7 const errors = validationResult(req)
8 8
9 if (!errors.isEmpty()) { 9 if (!errors.isEmpty()) {
10 logger.warn('Incorrect request parameters', { path: req.originalUrl, err: errors.mapped() }) 10 logger.warn('Incorrect request parameters', { path: req.originalUrl, err: errors.mapped() })
11 return res.status(statusCode).json({ errors: errors.mapped() }) 11 return res.status(400).json({ errors: errors.mapped() })
12 } 12 }
13 13
14 return next() 14 return next()