Don't include banners in account API

pull/6399/head
Chocobozzz 2024-05-29 09:00:43 +02:00
父节点 605f5328c1
当前提交 b65d639695
找不到此签名对应的密钥
GPG 密钥 ID: 583A612D890159BE
共有 2 个文件被更改,包括 5 次插入3 次删除

查看文件

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

查看文件

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