X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Faccount%2Faccount-blocklist.ts;h=b2375b00648ac8a79d2aa0e05750a64744c7321d;hb=8ee37c5f38b0f9b7e97239197d5590109c163250;hp=577b7dc192fb88175a16c7b1949d17908d84673c;hpb=d95d15598847c7f020aa056e7e6e0c02d2bbf732;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/account/account-blocklist.ts b/server/models/account/account-blocklist.ts index 577b7dc19..b2375b006 100644 --- a/server/models/account/account-blocklist.ts +++ b/server/models/account/account-blocklist.ts @@ -1,9 +1,9 @@ -import * as Bluebird from 'bluebird' import { Op } from 'sequelize' import { BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' import { MAccountBlocklist, MAccountBlocklistAccounts, MAccountBlocklistFormattable } from '@server/types/models' +import { AttributesOnly } from '@shared/core-utils' import { AccountBlock } from '../../../shared/models' -import { ActorModel } from '../activitypub/actor' +import { ActorModel } from '../actor/actor' import { ServerModel } from '../server/server' import { getSort, searchAttribute } from '../utils' import { AccountModel } from './account' @@ -41,7 +41,7 @@ enum ScopeNames { } ] }) -export class AccountBlocklistModel extends Model { +export class AccountBlocklistModel extends Model>> { @CreatedAt createdAt: Date @@ -102,7 +102,7 @@ export class AccountBlocklistModel extends Model { }) } - static loadByAccountAndTarget (accountId: number, targetAccountId: number): Bluebird { + static loadByAccountAndTarget (accountId: number, targetAccountId: number): Promise { const query = { where: { accountId, @@ -151,9 +151,9 @@ export class AccountBlocklistModel extends Model { }) } - static listHandlesBlockedBy (accountIds: number[]): Bluebird { + static listHandlesBlockedBy (accountIds: number[]): Promise { const query = { - attributes: [], + attributes: [ 'id' ], where: { accountId: { [Op.in]: accountIds