aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/search.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-17 16:02:38 +0200
committerChocobozzz <chocobozzz@cpy.re>2021-06-25 14:44:01 +0200
commit37a44fc915eef2140e22ceb96aba6b6eb2509007 (patch)
treedd4a370ecc96cf38c99b940261aadc27065da7ae /server/middlewares/validators/search.ts
parent33eb19e5199cc9fa4d73c6675c97508e3e072ef9 (diff)
downloadPeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.tar.gz
PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.tar.zst
PeerTube-37a44fc915eef2140e22ceb96aba6b6eb2509007.zip
Add ability to search playlists
Diffstat (limited to 'server/middlewares/validators/search.ts')
-rw-r--r--server/middlewares/validators/search.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/middlewares/validators/search.ts b/server/middlewares/validators/search.ts
index e2e1c6aae..7bbf81048 100644
--- a/server/middlewares/validators/search.ts
+++ b/server/middlewares/validators/search.ts
@@ -49,11 +49,12 @@ const videoChannelsListSearchValidator = [
49 } 49 }
50] 50]
51 51
52const videoChannelsOwnSearchValidator = [ 52const videoPlaylistsListSearchValidator = [
53 query('search').optional().not().isEmpty().withMessage('Should have a valid search'), 53 query('search').not().isEmpty().withMessage('Should have a valid search'),
54 query('searchTarget').optional().custom(isSearchTargetValid).withMessage('Should have a valid search target'),
54 55
55 (req: express.Request, res: express.Response, next: express.NextFunction) => { 56 (req: express.Request, res: express.Response, next: express.NextFunction) => {
56 logger.debug('Checking video channels search query', { parameters: req.query }) 57 logger.debug('Checking video playlists search query', { parameters: req.query })
57 58
58 if (areValidationErrors(req, res)) return 59 if (areValidationErrors(req, res)) return
59 60
@@ -66,5 +67,5 @@ const videoChannelsOwnSearchValidator = [
66export { 67export {
67 videosSearchValidator, 68 videosSearchValidator,
68 videoChannelsListSearchValidator, 69 videoChannelsListSearchValidator,
69 videoChannelsOwnSearchValidator 70 videoPlaylistsListSearchValidator
70} 71}