bug fixes

This commit is contained in:
undefined committed 2025-12-11 00:17:27 +08:00
1 parent 5ba7e0016e
commit b9c6252755
13 files changed
+27 -25

No files matched your search

+2 -1
View File
@@ -387,7 +387,7 @@ export class ContestEditHandler extends Handler {
@param('duration', Types.Float)
@param('title', Types.Title)
@param('content', Types.Content)
@param('rule', Types.Range(Object.keys(contest.RULES).filter((i) => !contest.RULES[i].hidden)))
@param('rule', Types.String)
@param('pids', Types.Content)
@param('rated', Types.Boolean)
@param('code', Types.String, true)
@@ -405,6 +405,7 @@ export class ContestEditHandler extends Handler {
_code = '', autoHide = false, assign: string[] = [], lock: number = null,
contestDuration: number = null, maintainer: number[] = [], allowViewCode = false, allowPrint = false, langs: string[] = [],
) {
if (!Object.keys(contest.RULES).includes(rule) || contest.RULES[rule].hidden) throw new ValidationError('rule');
if (autoHide) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
const pids = _pids.replace(/,/g, ',').split(',').map((i) => +i).filter((i) => i);
const beginAtMoment = moment.tz(`${beginAtDate} ${beginAtTime}`, this.user.timeZone);