-import { body, param } from 'express-validator/check'
-import { getServerAccount, isTestInstance, logger } from '../../helpers'
-import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc'
-import { isEachUniqueHostValid } from '../../helpers/custom-validators/servers'
-import { CONFIG } from '../../initializers'
-import { AccountFollowModel } from '../../models/account/account-follow'
-import { areValidationErrors } from './utils'
+import { body, param, query } from 'express-validator'
+import { isEachUniqueHandleValid, isFollowStateValid, isRemoteHandleValid } from '@server/helpers/custom-validators/follows'
+import { loadActorUrlOrGetFromWebfinger } from '@server/lib/activitypub/actors'
+import { getRemoteNameAndHost } from '@server/lib/activitypub/follow'
+import { getServerActor } from '@server/models/application/application'
+import { MActorFollowActorsDefault } from '@server/types/models'
+import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
+import { isTestInstance } from '../../helpers/core-utils'
+import { isActorTypeValid, isValidActorHandle } from '../../helpers/custom-validators/activitypub/actor'
+import { isEachUniqueHostValid, isHostValid } from '../../helpers/custom-validators/servers'
+import { logger } from '../../helpers/logger'
+import { WEBSERVER } from '../../initializers/constants'
+import { ActorModel } from '../../models/actor/actor'
+import { ActorFollowModel } from '../../models/actor/actor-follow'
+import { areValidationErrors } from './shared'
+import { ServerFollowCreate } from '@shared/models'
+
+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
+
+ return next()
+ }
+]