aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/user-subscriptions.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-07-23 21:30:04 +0200
committerRigel Kent <par@rigelk.eu>2020-07-29 18:15:53 +0200
commit4f5d045960b042eb27e10bac1bdaf1c074c9fa2a (patch)
tree09e1e8cce0a2e64146ede51941cfa2f1bdcf3c2f /server/middlewares/validators/user-subscriptions.ts
parentbc99dfe54e093e69ba8fd06d36b36fbbda3f45de (diff)
downloadPeerTube-4f5d045960b042eb27e10bac1bdaf1c074c9fa2a.tar.gz
PeerTube-4f5d045960b042eb27e10bac1bdaf1c074c9fa2a.tar.zst
PeerTube-4f5d045960b042eb27e10bac1bdaf1c074c9fa2a.zip
harmonize search for libraries
Diffstat (limited to 'server/middlewares/validators/user-subscriptions.ts')
-rw-r--r--server/middlewares/validators/user-subscriptions.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/server/middlewares/validators/user-subscriptions.ts b/server/middlewares/validators/user-subscriptions.ts
index 5d4cc94c5..a54ecb704 100644
--- a/server/middlewares/validators/user-subscriptions.ts
+++ b/server/middlewares/validators/user-subscriptions.ts
@@ -7,6 +7,18 @@ import { areValidActorHandles, isValidActorHandle } from '../../helpers/custom-v
7import { toArray } from '../../helpers/custom-validators/misc' 7import { toArray } from '../../helpers/custom-validators/misc'
8import { WEBSERVER } from '../../initializers/constants' 8import { WEBSERVER } from '../../initializers/constants'
9 9
10const userSubscriptionListValidator = [
11 query('search').optional().not().isEmpty().withMessage('Should have a valid search'),
12
13 (req: express.Request, res: express.Response, next: express.NextFunction) => {
14 logger.debug('Checking userSubscriptionListValidator parameters', { parameters: req.query })
15
16 if (areValidationErrors(req, res)) return
17
18 return next()
19 }
20]
21
10const userSubscriptionAddValidator = [ 22const userSubscriptionAddValidator = [
11 body('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to follow (username@domain)'), 23 body('uri').custom(isValidActorHandle).withMessage('Should have a valid URI to follow (username@domain)'),
12 24
@@ -64,6 +76,7 @@ const userSubscriptionGetValidator = [
64 76
65export { 77export {
66 areSubscriptionsExistValidator, 78 areSubscriptionsExistValidator,
79 userSubscriptionListValidator,
67 userSubscriptionAddValidator, 80 userSubscriptionAddValidator,
68 userSubscriptionGetValidator 81 userSubscriptionGetValidator
69} 82}