From b65d639695e22cc1876cd83d0668e603c954cb61 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 29 May 2024 09:00:43 +0200 Subject: [PATCH] Don't include banners in account API --- server/core/models/account/account.ts | 2 +- server/core/models/actor/actor.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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 } }