core: show accepted problems

This commit is contained in:
undefined committed 2021-12-07 22:37:55 +08:00
1 parent 06857affb1
commit 8d7a446066
7 files changed
+101 -12

No files matched your search

+2 -1
View File
@@ -274,6 +274,7 @@ export class ProblemModel {
static async getList(
domainId: string, pids: number[],
getHidden: number | boolean = false, doThrow = true, projection = ProblemModel.PROJECTION_PUBLIC,
indexByDocIdOnly = false,
): Promise<ProblemDict> {
const r: Record<number, ProblemDoc> = {};
const l: Record<string, ProblemDoc> = {};
@@ -300,7 +301,7 @@ export class ProblemModel {
}
}
}
return Object.assign(r, l);
return indexByDocIdOnly ? r : Object.assign(r, l);
}
static async getPrefixList(domainId: string, prefix: string) {