diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-07-15 11:17:03 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-07-29 18:15:53 +0200 |
commit | bc99dfe54e093e69ba8fd06d36b36fbbda3f45de (patch) | |
tree | 2c13497b77928c2593310746e3ec33333e2b4d66 /server/middlewares/validators | |
parent | 654a188f80fc1f089aa14837084664c908fe27d2 (diff) | |
download | PeerTube-bc99dfe54e093e69ba8fd06d36b36fbbda3f45de.tar.gz PeerTube-bc99dfe54e093e69ba8fd06d36b36fbbda3f45de.tar.zst PeerTube-bc99dfe54e093e69ba8fd06d36b36fbbda3f45de.zip |
variable columns for users list, more columns possible, badge display for statuses
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r-- | server/middlewares/validators/search.ts | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/server/middlewares/validators/search.ts b/server/middlewares/validators/search.ts index b4faa8894..7313bc055 100644 --- a/server/middlewares/validators/search.ts +++ b/server/middlewares/validators/search.ts | |||
@@ -41,9 +41,22 @@ const videoChannelsSearchValidator = [ | |||
41 | } | 41 | } |
42 | ] | 42 | ] |
43 | 43 | ||
44 | const videoChannelsOwnSearchValidator = [ | ||
45 | query('search').optional().not().isEmpty().withMessage('Should have a valid search'), | ||
46 | |||
47 | (req: express.Request, res: express.Response, next: express.NextFunction) => { | ||
48 | logger.debug('Checking video channels search query', { parameters: req.query }) | ||
49 | |||
50 | if (areValidationErrors(req, res)) return | ||
51 | |||
52 | return next() | ||
53 | } | ||
54 | ] | ||
55 | |||
44 | // --------------------------------------------------------------------------- | 56 | // --------------------------------------------------------------------------- |
45 | 57 | ||
46 | export { | 58 | export { |
59 | videosSearchValidator, | ||
47 | videoChannelsSearchValidator, | 60 | videoChannelsSearchValidator, |
48 | videosSearchValidator | 61 | videoChannelsOwnSearchValidator |
49 | } | 62 | } |