mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-25 23:45:13 +00:00
fix(backend): user.memoはdetailがtrueな時だけに
This commit is contained in:
parent
97abfd48ce
commit
5cac1515fd
1 changed files with 4 additions and 9 deletions
|
@ -340,11 +340,6 @@ export class UserEntityService implements OnModuleInit {
|
|||
|
||||
const falsy = opts.detail ? false : undefined;
|
||||
|
||||
const memo = meId == null ? null : await this.userMemosRepository.findOneBy({
|
||||
userId: meId,
|
||||
targetUserId: user.id,
|
||||
}).then(row => row?.memo ?? null);
|
||||
|
||||
const packed = {
|
||||
id: user.id,
|
||||
name: user.name,
|
||||
|
@ -417,6 +412,10 @@ export class UserEntityService implements OnModuleInit {
|
|||
isAdministrator: role.isAdministrator,
|
||||
displayOrder: role.displayOrder,
|
||||
}))),
|
||||
memo: meId == null ? null : await this.userMemosRepository.findOneBy({
|
||||
userId: meId,
|
||||
targetUserId: user.id,
|
||||
}).then(row => row?.memo ?? null),
|
||||
} : {}),
|
||||
|
||||
...(opts.detail && isMe ? {
|
||||
|
@ -484,10 +483,6 @@ export class UserEntityService implements OnModuleInit {
|
|||
isMuted: relation.isMuted,
|
||||
isRenoteMuted: relation.isRenoteMuted,
|
||||
} : {}),
|
||||
|
||||
...(memo ? {
|
||||
memo,
|
||||
} : {}),
|
||||
} as Promiseable<Packed<'User'>> as Promiseable<IsMeAndIsUserDetailed<ExpectsMe, D>>;
|
||||
|
||||
return await awaitAll(packed);
|
||||
|
|
Loading…
Reference in a new issue