core: fix contestDuration default value

This commit is contained in:
undefined committed 2022-07-13 14:38:10 +08:00
1 parent c4897b0aba
commit 0b389cbbfd
2 files changed
+2 -3

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.14.11",
"version": "3.14.12",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+1 -2
View File
@@ -278,7 +278,7 @@ export class ContestEditHandler extends Handler {
domainId: string, tid: ObjectID, beginAtDate: string, beginAtTime: string, duration: number,
title: string, content: string, rule: string, _pids: string, rated = false,
_code = '', autoHide = false, assign: string[] = null, lock: number = null,
contestDuration?: number,
contestDuration: number = null,
) {
if (autoHide) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
const pids = _pids.replace(/,/g, ',').split(',').map((i) => +i).filter((i) => i);
@@ -288,7 +288,6 @@ export class ContestEditHandler extends Handler {
if (beginAtMoment.isSameOrAfter(endAt)) throw new ValidationError('duration');
const beginAt = beginAtMoment.toDate();
const lockAt = lock ? moment(endAt).add(-lock, 'minutes').toDate() : null;
contestDuration ||= duration;
await problem.getList(domainId, pids, this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || this.user._id, this.user.group, true);
if (tid) {
await contest.edit(domainId, tid, {