mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: record_list: add projection for problem
This commit is contained in:
1 parent
018257f2b8
commit
b84a6426dd
1 file changed
+5
-3
@@ -1,4 +1,6 @@
|
||||
import { omit, pick, throttle } from 'lodash';
|
||||
import {
|
||||
omit, pick, throttle, uniqBy,
|
||||
} from 'lodash';
|
||||
import { FilterQuery, ObjectID } from 'mongodb';
|
||||
import {
|
||||
ContestNotAttendedError, ContestNotFoundError, HackRejudgeFailedError,
|
||||
@@ -91,8 +93,8 @@ class RecordListHandler extends ContestDetailBaseHandler {
|
||||
: await Promise.all([
|
||||
user.getList(domainId, rdocs.map((rdoc) => rdoc.uid)),
|
||||
canViewProblem
|
||||
? problem.getList(domainId, rdocs.map((rdoc) => rdoc.pid), canViewHiddenProblem, false)
|
||||
: Object.fromEntries([rdocs.map((rdoc) => [rdoc.pid, { ...problem.default, pid: rdoc.pid }])]),
|
||||
? problem.getList(domainId, rdocs.map((rdoc) => rdoc.pid), canViewHiddenProblem, false, problem.PROJECTION_LIST)
|
||||
: Object.fromEntries(uniqBy(rdocs, 'pid').map((rdoc) => [rdoc.pid, { ...problem.default, pid: rdoc.pid }])),
|
||||
]);
|
||||
this.response.body = {
|
||||
page,
|
||||
|
||||
Reference in new issue
Block a user