diff options
author | Chocobozzz <me@florianbigard.com> | 2019-11-29 10:55:17 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-11-29 10:55:17 +0100 |
commit | 97ecddae104f4013d261f0e9645e8b319ff0f1a6 (patch) | |
tree | 74e00ace03bcdfd91684c889b866f30ec2c6d244 /server/middlewares/validators | |
parent | f5b72c3937c721258c569ee783503adb379c42ab (diff) | |
download | PeerTube-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.ts | 5 |
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' | |||
9 | import { areValidationErrors } from './utils' | 9 | import { areValidationErrors } from './utils' |
10 | import { ActorModel } from '../../models/activitypub/actor' | 10 | import { ActorModel } from '../../models/activitypub/actor' |
11 | import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger' | 11 | import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger' |
12 | import { isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' | 12 | import { isActorTypeValid, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' |
13 | import { MActorFollowActorsDefault } from '@server/typings/models' | 13 | import { MActorFollowActorsDefault } from '@server/typings/models' |
14 | import { isFollowStateValid } from '@server/helpers/custom-validators/follows' | 14 | import { 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 |