mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +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) {
|
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(
|
const res = await document.getMultiStatus(
|
||||||
domainId, document.TYPE_PROBLEM_SOLUTION, { uid, psid: { $in: psids } },
|
domainId, document.TYPE_PROBLEM_SOLUTION, { uid, docId: { $in: psids } },
|
||||||
).toArray();
|
).project({ docId: 1, vote: 1 }).toArray();
|
||||||
for (const i of res) result[i.psid] = i;
|
for (const i of res) result[i.docId] = i;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user