core: always pick tsdoc endAt field (#1156)

This commit is contained in:
Baoshuo authored and GitHub committed 2026-05-07 23:33:45 +08:00
1 parent cc74b995ee
commit e3fa08f56c
2 files changed
+3 -3

No files matched your search

+1 -2
View File
@@ -366,8 +366,7 @@ export class ProblemDetailHandler extends ContestDetailBaseHandler {
: problem.canViewBy(this.pdoc, this.user) ? 'correction' : 'none',
};
if (this.tdoc && this.tsdoc) {
const fields = ['attend', 'startAt'];
if (this.tdoc.duration) fields.push('endAt');
const fields = ['attend', 'startAt', 'endAt'];
if (contest.canShowSelfRecord.call(this, this.tdoc, true)) fields.push('detail');
this.tsdoc = pick(this.tsdoc, fields);
this.response.body.tsdoc = this.tsdoc;