1
0
Fork 0

Don't include banners in account API

This commit is contained in:
Chocobozzz 2024-05-29 09:00:43 +02:00
parent 605f5328c1
commit b65d639695
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 5 additions and 3 deletions

View file

@ -408,7 +408,7 @@ export class AccountModel extends SequelizeModel<AccountModel> {
toFormattedJSON (this: MAccountFormattable): Account {
return {
...this.Actor.toFormattedJSON(),
...this.Actor.toFormattedJSON(false),
id: this.id,
displayName: this.getDisplayName(),

View file

@ -542,7 +542,7 @@ export class ActorModel extends SequelizeModel<ActorModel> {
}
}
toFormattedJSON (this: MActorFormattable) {
toFormattedJSON (this: MActorFormattable, includeBanner = true) {
return {
...this.toFormattedSummaryJSON(),
@ -552,7 +552,9 @@ export class ActorModel extends SequelizeModel<ActorModel> {
followersCount: this.followersCount,
createdAt: this.getCreatedAt(),
banners: (this.Banners || []).map(b => b.toFormattedJSON())
banners: includeBanner
? (this.Banners || []).map(b => b.toFormattedJSON())
: undefined
}
}