mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: ContestUser: fix endAt calculation
This commit is contained in:
1 file changed
+1
-1
@@ -613,7 +613,7 @@ export class ContestUserHandler extends ContestManagementBaseHandler {
|
|||||||
async get(domainId: string, tid: ObjectId) {
|
async get(domainId: string, tid: ObjectId) {
|
||||||
const tsdocs = await contest.getMultiStatus(domainId, { docId: tid }).toArray();
|
const tsdocs = await contest.getMultiStatus(domainId, { docId: tid }).toArray();
|
||||||
tsdocs.forEach((i) => {
|
tsdocs.forEach((i) => {
|
||||||
i.endAt = this.tdoc.duration ? moment(this.tsdoc.startAt).add(this.tdoc.duration, 'hours').toDate() : null;
|
i.endAt = (this.tdoc.duration && i.startAt) ? moment(i.startAt).add(this.tdoc.duration, 'hours').toDate() : null;
|
||||||
});
|
});
|
||||||
const udict = await user.getListForRender(domainId, [this.tdoc.owner, ...tsdocs.map((i) => i.uid)]);
|
const udict = await user.getListForRender(domainId, [this.tdoc.owner, ...tsdocs.map((i) => i.uid)]);
|
||||||
this.response.body = { tdoc: this.tdoc, tsdocs, udict };
|
this.response.body = { tdoc: this.tdoc, tsdocs, udict };
|
||||||
|
|||||||
Reference in new issue
Block a user