core&ui: fix group filter display

This commit is contained in:
undefined committed 2023-06-30 01:06:19 +08:00
1 parent 9da4340a97
commit 4bb1e3a81f
5 files changed
+11 -6

No files matched your search

+1 -1
View File
@@ -77,7 +77,7 @@ export class ContestListHandler extends Handler {
@param('page', Types.PositiveInt, true)
async get(domainId: string, rule = '', group = '', page = 1) {
if (rule && contest.RULES[rule].hidden) throw new BadRequestError();
const groups = (await user.listGroup(domainId, this.user._id)).map((i) => i.name);
const groups = (await user.listGroup(domainId, this.user._id)).map((i) => i.name).filter((i) => !Number.isSafeInteger(+i));
if (group && !groups.includes(group)) throw new NotAssignedError(group);
const rules = Object.keys(contest.RULES).filter((i) => !contest.RULES[i].hidden);
const q = {
+1 -1
View File
@@ -24,7 +24,7 @@ class HomeworkMainHandler extends Handler {
@param('group', Types.Name, true)
@param('page', Types.PositiveInt, true)
async get(domainId: string, group = '', page = 1) {
const groups = (await user.listGroup(domainId, this.user._id)).map((i) => i.name);
const groups = (await user.listGroup(domainId, this.user._id)).map((i) => i.name).filter((i) => !Number.isSafeInteger(+i));
if (group && !groups.includes(group)) throw new NotAssignedError(group);
const cursor = contest.getMulti(domainId, {
rule: 'homework',