diff options
Diffstat (limited to 'server/models/account/account-blocklist.ts')
-rw-r--r-- | server/models/account/account-blocklist.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/server/models/account/account-blocklist.ts b/server/models/account/account-blocklist.ts index 577b7dc19..fe9168ab8 100644 --- a/server/models/account/account-blocklist.ts +++ b/server/models/account/account-blocklist.ts | |||
@@ -1,4 +1,3 @@ | |||
1 | import * as Bluebird from 'bluebird' | ||
2 | import { Op } from 'sequelize' | 1 | import { Op } from 'sequelize' |
3 | import { BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' | 2 | import { BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' |
4 | import { MAccountBlocklist, MAccountBlocklistAccounts, MAccountBlocklistFormattable } from '@server/types/models' | 3 | import { MAccountBlocklist, MAccountBlocklistAccounts, MAccountBlocklistFormattable } from '@server/types/models' |
@@ -41,7 +40,7 @@ enum ScopeNames { | |||
41 | } | 40 | } |
42 | ] | 41 | ] |
43 | }) | 42 | }) |
44 | export class AccountBlocklistModel extends Model<AccountBlocklistModel> { | 43 | export class AccountBlocklistModel extends Model { |
45 | 44 | ||
46 | @CreatedAt | 45 | @CreatedAt |
47 | createdAt: Date | 46 | createdAt: Date |
@@ -102,7 +101,7 @@ export class AccountBlocklistModel extends Model<AccountBlocklistModel> { | |||
102 | }) | 101 | }) |
103 | } | 102 | } |
104 | 103 | ||
105 | static loadByAccountAndTarget (accountId: number, targetAccountId: number): Bluebird<MAccountBlocklist> { | 104 | static loadByAccountAndTarget (accountId: number, targetAccountId: number): Promise<MAccountBlocklist> { |
106 | const query = { | 105 | const query = { |
107 | where: { | 106 | where: { |
108 | accountId, | 107 | accountId, |
@@ -151,9 +150,9 @@ export class AccountBlocklistModel extends Model<AccountBlocklistModel> { | |||
151 | }) | 150 | }) |
152 | } | 151 | } |
153 | 152 | ||
154 | static listHandlesBlockedBy (accountIds: number[]): Bluebird<string[]> { | 153 | static listHandlesBlockedBy (accountIds: number[]): Promise<string[]> { |
155 | const query = { | 154 | const query = { |
156 | attributes: [], | 155 | attributes: [ 'id' ], |
157 | where: { | 156 | where: { |
158 | accountId: { | 157 | accountId: { |
159 | [Op.in]: accountIds | 158 | [Op.in]: accountIds |