mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: always pick tsdoc endAt field (#1156)
This commit is contained in:
1 parent
cc74b995ee
commit
e3fa08f56c
2 files changed
+3
-3
No files matched your search
@@ -195,7 +195,8 @@ export class ContestDetailHandler extends ContestDetailBaseHandler {
|
||||
if (this.tdoc.rule === 'homework') throw new ContestNotFoundError(domainId, tid);
|
||||
if (!this.tsdoc?.attend) throw new ContestNotAttendedError(domainId, tid);
|
||||
if (!contest.isOngoing(this.tdoc, this.tsdoc)) throw new ContestNotLiveError(domainId, tid);
|
||||
await contest.setStatus(domainId, tid, this.user._id, { endAt: new Date() });
|
||||
const now = new Date();
|
||||
await contest.setStatus(domainId, tid, this.user._id, { endAt: now, ...(!this.tsdoc.startAt ? { startAt: now } : {}) });
|
||||
this.back();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user