From 97ecddae104f4013d261f0e9645e8b319ff0f1a6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 29 Nov 2019 10:55:17 +0100 Subject: Filter on follows actor types in about page --- server/middlewares/validators/follows.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server/middlewares/validators/follows.ts') 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' import { areValidationErrors } from './utils' import { ActorModel } from '../../models/activitypub/actor' import { loadActorUrlOrGetFromWebfinger } from '../../helpers/webfinger' -import { isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' +import { isActorTypeValid, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor' import { MActorFollowActorsDefault } from '@server/typings/models' import { isFollowStateValid } from '@server/helpers/custom-validators/follows' @@ -17,6 +17,9 @@ const listFollowsValidator = [ query('state') .optional() .custom(isFollowStateValid).withMessage('Should have a valid follow state'), + query('actorType') + .optional() + .custom(isActorTypeValid).withMessage('Should have a valid actor type'), (req: express.Request, res: express.Response, next: express.NextFunction) => { if (areValidationErrors(req, res)) return -- cgit v1.2.3