mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-22 14:05:12 +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 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 = {
|
const packed = {
|
||||||
id: user.id,
|
id: user.id,
|
||||||
name: user.name,
|
name: user.name,
|
||||||
|
@ -417,6 +412,10 @@ export class UserEntityService implements OnModuleInit {
|
||||||
isAdministrator: role.isAdministrator,
|
isAdministrator: role.isAdministrator,
|
||||||
displayOrder: role.displayOrder,
|
displayOrder: role.displayOrder,
|
||||||
}))),
|
}))),
|
||||||
|
memo: meId == null ? null : await this.userMemosRepository.findOneBy({
|
||||||
|
userId: meId,
|
||||||
|
targetUserId: user.id,
|
||||||
|
}).then(row => row?.memo ?? null),
|
||||||
} : {}),
|
} : {}),
|
||||||
|
|
||||||
...(opts.detail && isMe ? {
|
...(opts.detail && isMe ? {
|
||||||
|
@ -484,10 +483,6 @@ export class UserEntityService implements OnModuleInit {
|
||||||
isMuted: relation.isMuted,
|
isMuted: relation.isMuted,
|
||||||
isRenoteMuted: relation.isRenoteMuted,
|
isRenoteMuted: relation.isRenoteMuted,
|
||||||
} : {}),
|
} : {}),
|
||||||
|
|
||||||
...(memo ? {
|
|
||||||
memo,
|
|
||||||
} : {}),
|
|
||||||
} as Promiseable<Packed<'User'>> as Promiseable<IsMeAndIsUserDetailed<ExpectsMe, D>>;
|
} as Promiseable<Packed<'User'>> as Promiseable<IsMeAndIsUserDetailed<ExpectsMe, D>>;
|
||||||
|
|
||||||
return await awaitAll(packed);
|
return await awaitAll(packed);
|
||||||
|
|
Loading…
Reference in a new issue