aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/videos
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/videos')
-rw-r--r--server/middlewares/validators/videos/video-channels.ts14
1 files changed, 12 insertions, 2 deletions
diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts
index ebce14714..882fb2b84 100644
--- a/server/middlewares/validators/videos/video-channels.ts
+++ b/server/middlewares/validators/videos/video-channels.ts
@@ -1,5 +1,5 @@
1import * as express from 'express' 1import * as express from 'express'
2import { body, param } from 'express-validator' 2import { body, param, query } from 'express-validator'
3import { UserRight } from '../../../../shared' 3import { UserRight } from '../../../../shared'
4import { 4import {
5 isVideoChannelDescriptionValid, 5 isVideoChannelDescriptionValid,
@@ -128,6 +128,15 @@ const localVideoChannelValidator = [
128 } 128 }
129] 129]
130 130
131const videoChannelStatsValidator = [
132 query('withStats').optional().isBoolean().withMessage('Should have a valid stats flag'),
133
134 (req: express.Request, res: express.Response, next: express.NextFunction) => {
135 if (areValidationErrors(req, res)) return
136 return next()
137 }
138]
139
131// --------------------------------------------------------------------------- 140// ---------------------------------------------------------------------------
132 141
133export { 142export {
@@ -135,7 +144,8 @@ export {
135 videoChannelsUpdateValidator, 144 videoChannelsUpdateValidator,
136 videoChannelsRemoveValidator, 145 videoChannelsRemoveValidator,
137 videoChannelsNameWithHostValidator, 146 videoChannelsNameWithHostValidator,
138 localVideoChannelValidator 147 localVideoChannelValidator,
148 videoChannelStatsValidator
139} 149}
140 150
141// --------------------------------------------------------------------------- 151// ---------------------------------------------------------------------------