diff options
Diffstat (limited to 'server/middlewares/validators/videos')
-rw-r--r-- | server/middlewares/validators/videos/video-channels.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts index 911a25bfb..e7df185e4 100644 --- a/server/middlewares/validators/videos/video-channels.ts +++ b/server/middlewares/validators/videos/video-channels.ts | |||
@@ -141,6 +141,18 @@ const videoChannelStatsValidator = [ | |||
141 | } | 141 | } |
142 | ] | 142 | ] |
143 | 143 | ||
144 | const videoChannelsListValidator = [ | ||
145 | query('search').optional().not().isEmpty().withMessage('Should have a valid search'), | ||
146 | |||
147 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | ||
148 | logger.debug('Checking video channels search query', { parameters: req.query }) | ||
149 | |||
150 | if (areValidationErrors(req, res)) return | ||
151 | |||
152 | return next() | ||
153 | } | ||
154 | ] | ||
155 | |||
144 | // --------------------------------------------------------------------------- | 156 | // --------------------------------------------------------------------------- |
145 | 157 | ||
146 | export { | 158 | export { |
@@ -148,6 +160,7 @@ export { | |||
148 | videoChannelsUpdateValidator, | 160 | videoChannelsUpdateValidator, |
149 | videoChannelsRemoveValidator, | 161 | videoChannelsRemoveValidator, |
150 | videoChannelsNameWithHostValidator, | 162 | videoChannelsNameWithHostValidator, |
163 | videoChannelsListValidator, | ||
151 | localVideoChannelValidator, | 164 | localVideoChannelValidator, |
152 | videoChannelStatsValidator | 165 | videoChannelStatsValidator |
153 | } | 166 | } |