diff --git a/server/core/models/account/account.ts b/server/core/models/account/account.ts index 0611fb25f..518794ad7 100644 --- a/server/core/models/account/account.ts +++ b/server/core/models/account/account.ts @@ -408,7 +408,7 @@ export class AccountModel extends SequelizeModel { toFormattedJSON (this: MAccountFormattable): Account { return { - ...this.Actor.toFormattedJSON(), + ...this.Actor.toFormattedJSON(false), id: this.id, displayName: this.getDisplayName(), diff --git a/server/core/models/actor/actor.ts b/server/core/models/actor/actor.ts index 1ec75bb22..d9586a9d7 100644 --- a/server/core/models/actor/actor.ts +++ b/server/core/models/actor/actor.ts @@ -542,7 +542,7 @@ export class ActorModel extends SequelizeModel { } } - toFormattedJSON (this: MActorFormattable) { + toFormattedJSON (this: MActorFormattable, includeBanner = true) { return { ...this.toFormattedSummaryJSON(), @@ -552,7 +552,9 @@ export class ActorModel extends SequelizeModel { followersCount: this.followersCount, createdAt: this.getCreatedAt(), - banners: (this.Banners || []).map(b => b.toFormattedJSON()) + banners: includeBanner + ? (this.Banners || []).map(b => b.toFormattedJSON()) + : undefined } }