diff options
Diffstat (limited to 'server/helpers/middlewares/accounts.ts')
-rw-r--r-- | server/helpers/middlewares/accounts.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/server/helpers/middlewares/accounts.ts b/server/helpers/middlewares/accounts.ts index 23470cac6..13ae6cdf4 100644 --- a/server/helpers/middlewares/accounts.ts +++ b/server/helpers/middlewares/accounts.ts | |||
@@ -1,9 +1,8 @@ | |||
1 | import { Response } from 'express' | 1 | import { Response } from 'express' |
2 | import { AccountModel } from '../../models/account/account' | ||
3 | import * as Bluebird from 'bluebird' | ||
4 | import { MAccountDefault } from '../../types/models' | ||
5 | import { UserModel } from '@server/models/account/user' | 2 | import { UserModel } from '@server/models/account/user' |
6 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | 3 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' |
4 | import { AccountModel } from '../../models/account/account' | ||
5 | import { MAccountDefault } from '../../types/models' | ||
7 | 6 | ||
8 | function doesAccountIdExist (id: number | string, res: Response, sendNotFound = true) { | 7 | function doesAccountIdExist (id: number | string, res: Response, sendNotFound = true) { |
9 | const promise = AccountModel.load(parseInt(id + '', 10)) | 8 | const promise = AccountModel.load(parseInt(id + '', 10)) |
@@ -23,7 +22,7 @@ function doesAccountNameWithHostExist (nameWithDomain: string, res: Response, se | |||
23 | return doesAccountExist(promise, res, sendNotFound) | 22 | return doesAccountExist(promise, res, sendNotFound) |
24 | } | 23 | } |
25 | 24 | ||
26 | async function doesAccountExist (p: Bluebird<MAccountDefault>, res: Response, sendNotFound: boolean) { | 25 | async function doesAccountExist (p: Promise<MAccountDefault>, res: Response, sendNotFound: boolean) { |
27 | const account = await p | 26 | const account = await p |
28 | 27 | ||
29 | if (!account) { | 28 | if (!account) { |