From 3fd3ab2d34d512b160a5e6084d7609be7b4f4452 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 12 Dec 2017 17:53:50 +0100 Subject: Move models to typescript-sequelize --- server/middlewares/validators/follows.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'server/middlewares/validators/follows.ts') diff --git a/server/middlewares/validators/follows.ts b/server/middlewares/validators/follows.ts index 605872ecf..10482e5d0 100644 --- a/server/middlewares/validators/follows.ts +++ b/server/middlewares/validators/follows.ts @@ -1,12 +1,11 @@ import * as express from 'express' import { body, param } from 'express-validator/check' -import { isTestInstance } from '../../helpers/core-utils' +import { getServerAccount, isTestInstance, logger } from '../../helpers' +import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc' import { isEachUniqueHostValid } from '../../helpers/custom-validators/servers' -import { logger } from '../../helpers/logger' -import { CONFIG, database as db } from '../../initializers' +import { CONFIG } from '../../initializers' +import { AccountFollowModel } from '../../models/account/account-follow' import { areValidationErrors } from './utils' -import { getServerAccount } from '../../helpers/utils' -import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc' const followValidator = [ body('hosts').custom(isEachUniqueHostValid).withMessage('Should have an array of unique hosts'), @@ -38,7 +37,7 @@ const removeFollowingValidator = [ if (areValidationErrors(req, res)) return const serverAccount = await getServerAccount() - const follow = await db.AccountFollow.loadByAccountAndTarget(serverAccount.id, req.params.accountId) + const follow = await AccountFollowModel.loadByAccountAndTarget(serverAccount.id, req.params.accountId) if (!follow) { return res.status(404) -- cgit v1.2.3