From 32c52bab905884bda0d4d6c2b149d93251552bbf Mon Sep 17 00:00:00 2001 From: undefined Date: Sun, 8 Jan 2023 19:19:26 +0800 Subject: [PATCH] core: problem_solution: fix vote status response --- packages/hydrooj/src/model/solution.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hydrooj/src/model/solution.ts b/packages/hydrooj/src/model/solution.ts index 81902f19..a32e3669 100644 --- a/packages/hydrooj/src/model/solution.ts +++ b/packages/hydrooj/src/model/solution.ts @@ -79,11 +79,11 @@ class SolutionModel { } static async getListStatus(domainId: string, psids: ObjectID[], uid: number) { - const result: any = {}; + const result: Record = {}; const res = await document.getMultiStatus( - domainId, document.TYPE_PROBLEM_SOLUTION, { uid, psid: { $in: psids } }, - ).toArray(); - for (const i of res) result[i.psid] = i; + domainId, document.TYPE_PROBLEM_SOLUTION, { uid, docId: { $in: psids } }, + ).project({ docId: 1, vote: 1 }).toArray(); + for (const i of res) result[i.docId] = i; return result; } }