aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/middlewares')
-rw-r--r--server/helpers/middlewares/accounts.ts7
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 @@
1import { Response } from 'express' 1import { Response } from 'express'
2import { AccountModel } from '../../models/account/account'
3import * as Bluebird from 'bluebird'
4import { MAccountDefault } from '../../types/models'
5import { UserModel } from '@server/models/account/user' 2import { UserModel } from '@server/models/account/user'
6import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' 3import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
4import { AccountModel } from '../../models/account/account'
5import { MAccountDefault } from '../../types/models'
7 6
8function doesAccountIdExist (id: number | string, res: Response, sendNotFound = true) { 7function 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
26async function doesAccountExist (p: Bluebird<MAccountDefault>, res: Response, sendNotFound: boolean) { 25async 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) {