X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Faccount%2Faccount.ts;h=71a9b8ccbcf1df75f52bbe185de04b6fc8916f8b;hb=3c10840fa90fc88fc98e8169faf4745ff6c80893;hp=37194a119bb85b6ff1ecbc8d3919c25e8f1c7f4e;hpb=421ff4618da64f0849353383f690a014024c40da;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/account/account.ts b/server/models/account/account.ts index 37194a119..71a9b8ccb 100644 --- a/server/models/account/account.ts +++ b/server/models/account/account.ts @@ -99,7 +99,7 @@ export type SummaryOptions = { queryInclude.push({ attributes: [ 'id' ], model: AccountBlocklistModel.unscoped(), - as: 'BlockedAccounts', + as: 'BlockedBy', required: false, where: { accountId: { @@ -228,10 +228,10 @@ export class AccountModel extends Model>> { name: 'targetAccountId', allowNull: false }, - as: 'BlockedAccounts', + as: 'BlockedBy', onDelete: 'CASCADE' }) - BlockedAccounts: AccountBlocklistModel[] + BlockedBy: AccountBlocklistModel[] @BeforeDestroy static async sendDeleteIfOwned (instance: AccountModel, options) { @@ -457,6 +457,6 @@ export class AccountModel extends Model>> { } isBlocked () { - return this.BlockedAccounts && this.BlockedAccounts.length !== 0 + return this.BlockedBy && this.BlockedBy.length !== 0 } }