diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-17 16:02:38 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-06-25 14:44:01 +0200 |
commit | 37a44fc915eef2140e22ceb96aba6b6eb2509007 (patch) | |
tree | dd4a370ecc96cf38c99b940261aadc27065da7ae /server/middlewares/validators/videos | |
parent | 33eb19e5199cc9fa4d73c6675c97508e3e072ef9 (diff) | |
download | PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.tar.gz PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.tar.zst PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.zip |
Add ability to search playlists
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 | } |