aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/middlewares
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-08 14:30:29 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-12-09 11:41:22 +0100
commitb49f22d8f9a52ab75fd38db2d377249eb58fa678 (patch)
treea2825877d7b3b53454804a79c9d2a14c5d37385c /server/helpers/middlewares
parent6c8c15f914cd375da1db5d0cd4d924a86c53d4c1 (diff)
downloadPeerTube-b49f22d8f9a52ab75fd38db2d377249eb58fa678.tar.gz
PeerTube-b49f22d8f9a52ab75fd38db2d377249eb58fa678.tar.zst
PeerTube-b49f22d8f9a52ab75fd38db2d377249eb58fa678.zip
Upgrade sequelize to v6
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) {