aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators/follows.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/validators/follows.ts')
-rw-r--r--server/middlewares/validators/follows.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/follows.ts b/server/middlewares/validators/follows.ts
index e22349726..dfd6e7f03 100644
--- a/server/middlewares/validators/follows.ts
+++ b/server/middlewares/validators/follows.ts
@@ -1,12 +1,12 @@
1import * as express from 'express' 1import * as express from 'express'
2import { body } from 'express-validator/check' 2import { body, param } from 'express-validator/check'
3import { isTestInstance } from '../../helpers/core-utils' 3import { isTestInstance } from '../../helpers/core-utils'
4import { isAccountIdValid } from '../../helpers/custom-validators/activitypub/account'
5import { isEachUniqueHostValid } from '../../helpers/custom-validators/servers' 4import { isEachUniqueHostValid } from '../../helpers/custom-validators/servers'
6import { logger } from '../../helpers/logger' 5import { logger } from '../../helpers/logger'
7import { CONFIG, database as db } from '../../initializers' 6import { CONFIG, database as db } from '../../initializers'
8import { checkErrors } from './utils' 7import { checkErrors } from './utils'
9import { getServerAccount } from '../../helpers/utils' 8import { getServerAccount } from '../../helpers/utils'
9import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc'
10 10
11const followValidator = [ 11const followValidator = [
12 body('hosts').custom(isEachUniqueHostValid).withMessage('Should have an array of unique hosts'), 12 body('hosts').custom(isEachUniqueHostValid).withMessage('Should have an array of unique hosts'),
@@ -28,7 +28,7 @@ const followValidator = [
28] 28]
29 29
30const removeFollowingValidator = [ 30const removeFollowingValidator = [
31 body('accountId').custom(isAccountIdValid).withMessage('Should have a valid account id'), 31 param('accountId').custom(isIdOrUUIDValid).withMessage('Should have a valid account id'),
32 32
33 (req: express.Request, res: express.Response, next: express.NextFunction) => { 33 (req: express.Request, res: express.Response, next: express.NextFunction) => {
34 logger.debug('Checking follow parameters', { parameters: req.body }) 34 logger.debug('Checking follow parameters', { parameters: req.body })