diff options
| author | おさむのひと <46447427+samunohito@users.noreply.github.com> | 2024-05-10 15:32:23 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-10 15:32:23 +0900 |
| commit | b298897bdedc988800f72798cdbf2dbcd2e994ae (patch) | |
| tree | e3f5829e242e969b8726585ff92382bd720f4f6a | |
| parent | dev: modify release manager to set indent type (diff) | |
| download | sharkey-b298897bdedc988800f72798cdbf2dbcd2e994ae.tar.gz sharkey-b298897bdedc988800f72798cdbf2dbcd2e994ae.tar.bz2 sharkey-b298897bdedc988800f72798cdbf2dbcd2e994ae.zip | |
fix(backend): 不要なUserProfileの取得を修正 (#13812)
* fix(backend): 不要なuserProfileの取得を修正
* fix: pnpm@9.0.6 to pnpm@9.1.0
* Revert "fix: pnpm@9.0.6 to pnpm@9.1.0"
This reverts commit eaf265ec2cf255cadeaa516d5b668134bc397211.
| -rw-r--r-- | packages/backend/src/core/entities/UserEntityService.ts | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/packages/backend/src/core/entities/UserEntityService.ts b/packages/backend/src/core/entities/UserEntityService.ts index df2b27d709..d85f31a989 100644 --- a/packages/backend/src/core/entities/UserEntityService.ts +++ b/packages/backend/src/core/entities/UserEntityService.ts @@ -637,18 +637,17 @@ export class UserEntityService implements OnModuleInit { } const _userIds = _users.map(u => u.id); - // -- 特に前提条件のない値群を取得 - - const profilesMap = await this.userProfilesRepository.findBy({ userId: In(_userIds) }) - .then(profiles => new Map(profiles.map(p => [p.userId, p]))); - // -- 実行者の有無や指定スキーマの種別によって要否が異なる値群を取得 + let profilesMap: Map<MiUser['id'], MiUserProfile> = new Map(); let userRelations: Map<MiUser['id'], UserRelation> = new Map(); let userMemos: Map<MiUser['id'], string | null> = new Map(); let pinNotes: Map<MiUser['id'], MiUserNotePining[]> = new Map(); if (options?.schema !== 'UserLite') { + profilesMap = await this.userProfilesRepository.findBy({ userId: In(_userIds) }) + .then(profiles => new Map(profiles.map(p => [p.userId, p]))); + const meId = me ? me.id : null; if (meId) { userMemos = await this.userMemosRepository.findBy({ userId: meId }) |