aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares')
-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