From e760e476f5155952e595dd9168e385a7a29d3157 Mon Sep 17 00:00:00 2001 From: atsu1125 Date: Sat, 2 Dec 2023 13:53:51 +0900 Subject: [PATCH] Fix: users/show response wrong users --- src/server/api/endpoints/users/show.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server/api/endpoints/users/show.ts b/src/server/api/endpoints/users/show.ts index 9e0771a55a..e402444c11 100644 --- a/src/server/api/endpoints/users/show.ts +++ b/src/server/api/endpoints/users/show.ts @@ -83,12 +83,13 @@ export default define(meta, async (ps, me) => { // リクエストされた通りに並べ替え const _users = []; for (const id of ps.userIds) { - _users.push(users.find(x => x.id === id)); + const user = users.find((u) => u.id === id); + if (user) _users.push(user); } - return await Promise.all(_users.map(u => Users.pack(u, me, { - detail: true - }))); + return await Users.packMany(_users, me, { + detail: true, + }); } else { // Lookup user if (typeof ps.host === 'string' && typeof ps.username === 'string') {