aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-11-29 10:55:17 +0100
committerChocobozzz <me@florianbigard.com>2019-11-29 10:55:17 +0100
commit97ecddae104f4013d261f0e9645e8b319ff0f1a6 (patch)
tree74e00ace03bcdfd91684c889b866f30ec2c6d244 /server/middlewares/validators
parentf5b72c3937c721258c569ee783503adb379c42ab (diff)
downloadPeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.tar.gz
PeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.tar.zst
PeerTube-97ecddae104f4013d261f0e9645e8b319ff0f1a6.zip
Filter on follows actor types in about page
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/follows.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/middlewares/validators/follows.ts b/server/middlewares/validators/follows.ts
index 454f9f2b8..a98d32d86 100644
--- a/server/middlewares/validators/follows.ts
+++ b/server/middlewares/validators/follows.ts
@@ -9,7 +9,7 @@ import { ActorFollowModel } from '../../models/activitypub/actor-follow'
9import { areValidationErrors } from './utils' 9import { areValidationErrors } from './utils'
10import { ActorModel } from '../../models/activitypub/actor' 10import { ActorModel } from '../../models/activitypub/actor'
11import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger' 11import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger'
12import { isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' 12import { isActorTypeValid, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor'
13import { MActorFollowActorsDefault } from '@server/typings/models' 13import { MActorFollowActorsDefault } from '@server/typings/models'
14import { isFollowStateValid } from '@server/helpers/custom-validators/follows' 14import { isFollowStateValid } from '@server/helpers/custom-validators/follows'
15 15
@@ -17,6 +17,9 @@ const listFollowsValidator = [
17 query('state') 17 query('state')
18 .optional() 18 .optional()
19 .custom(isFollowStateValid).withMessage('Should have a valid follow state'), 19 .custom(isFollowStateValid).withMessage('Should have a valid follow state'),
20 query('actorType')
21 .optional()
22 .custom(isActorTypeValid).withMessage('Should have a valid actor type'),
20 23
21 (req: express.Request, res: express.Response, next: express.NextFunction) => { 24 (req: express.Request, res: express.Response, next: express.NextFunction) => {
22 if (areValidationErrors(req, res)) return 25 if (areValidationErrors(req, res)) return