From 37a44fc915eef2140e22ceb96aba6b6eb2509007 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 17 Jun 2021 16:02:38 +0200 Subject: Add ability to search playlists --- server/middlewares/validators/videos/video-channels.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'server/middlewares/validators/videos') 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 = [ } ] +const videoChannelsListValidator = [ + query('search').optional().not().isEmpty().withMessage('Should have a valid search'), + + (req: express.Request, res: express.Response, next: express.NextFunction) => { + logger.debug('Checking video channels search query', { parameters: req.query }) + + if (areValidationErrors(req, res)) return + + return next() + } +] + // --------------------------------------------------------------------------- export { @@ -148,6 +160,7 @@ export { videoChannelsUpdateValidator, videoChannelsRemoveValidator, videoChannelsNameWithHostValidator, + videoChannelsListValidator, localVideoChannelValidator, videoChannelStatsValidator } -- cgit v1.2.3