mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: problem_solution: fix vote status response
This commit is contained in:
1 parent
365864e515
commit
32c52bab90
1 file changed
+4
-4
@@ -79,11 +79,11 @@ class SolutionModel {
|
||||
}
|
||||
|
||||
static async getListStatus(domainId: string, psids: ObjectID[], uid: number) {
|
||||
const result: any = {};
|
||||
const result: Record<string, { docId: ObjectID, vote: number }> = {};
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user