From 2492f4e81e9403d6c6efca28f0f65f4eed57ea75 Mon Sep 17 00:00:00 2001 From: squidicuz Date: Thu, 10 Nov 2022 21:22:31 -0500 Subject: [PATCH] fix for pinned users. update changelog (#9159) --- CHANGELOG.md | 1 + packages/backend/src/server/api/endpoints/pinned-users.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66959cd71..d7513acdb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ You should also include the user name that made the change. ### Improvements ### Bugfixes +- Server: Bug fix for Pinned Users lookup on instance @squidicuzz ## 12.119.0 (2022/09/10) diff --git a/packages/backend/src/server/api/endpoints/pinned-users.ts b/packages/backend/src/server/api/endpoints/pinned-users.ts index 6c941314e..f2c6e798e 100644 --- a/packages/backend/src/server/api/endpoints/pinned-users.ts +++ b/packages/backend/src/server/api/endpoints/pinned-users.ts @@ -43,12 +43,12 @@ export default class extends Endpoint { super(meta, paramDef, async (ps, me) => { const meta = await this.metaService.fetch(); - const users = await Promise.all(meta.pinnedthis.usersRepository.map(acct => Acct.parse(acct)).map(acct => this.usersRepository.findOneBy({ + const users = await Promise.all(meta.pinnedUsers.map(acct => Acct.parse(acct)).map(acct => this.usersRepository.findOneBy({ usernameLower: acct.username.toLowerCase(), host: acct.host ?? IsNull(), }))); - return await this.userEntityService.packMany(users.filter(x => x !== undefined) as User[], me, { detail: true }); + return await this.userEntityService.packMany(users.filter(x => x !== null) as User[], me, { detail: true }); }); } }