This commit is contained in:
undefined committed 2022-01-24 00:00:37 +08:00
1 parent 688ccf811b
commit 775301c001
7 files changed
+56 -75

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.3.14",
"version": "3.3.15",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+11 -9
View File
@@ -301,15 +301,17 @@ class UserDetailHandler extends Handler {
const pdocs: ProblemDoc[] = [];
const acInfo: Record<string, number> = {};
const canViewHidden = this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || this.user._id;
await Promise.all([domainId, ...(union?.union || [])].map(async (did) => {
const psdocs = await problem.getMultiStatus(did, { uid, status: STATUS.STATUS_ACCEPTED }).toArray();
pdocs.push(...Object.values(
await problem.getList(
did, psdocs.map((i) => i.docId), canViewHidden,
this.user.group, false, undefined, true,
),
));
}));
if (this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) {
await Promise.all([domainId, ...(union?.union || [])].map(async (did) => {
const psdocs = await problem.getMultiStatus(did, { uid, status: STATUS.STATUS_ACCEPTED }).toArray();
pdocs.push(...Object.values(
await problem.getList(
did, psdocs.map((i) => i.docId), canViewHidden,
this.user.group, false, problem.PROJECTION_LIST, true,
),
));
}));
}
for (const pdoc of pdocs) {
for (const tag of pdoc.tag) {
if (acInfo[tag]) acInfo[tag]++;