mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-18 09:36:08 +08:00
eslint: add github/array-foreach rule
This commit is contained in:
21 files changed
+59
-51
No files matched your search
@@ -637,9 +637,9 @@ export class ContestUserHandler extends ContestManagementBaseHandler {
|
||||
const tsdocs = await contest.getMultiStatus(domainId, { docId: tid }).project({
|
||||
uid: 1, attend: 1, startAt: 1, unrank: 1,
|
||||
}).toArray();
|
||||
tsdocs.forEach((i) => {
|
||||
i.endAt = (this.tdoc.duration && i.startAt) ? moment(i.startAt).add(this.tdoc.duration, 'hours').toDate() : null;
|
||||
});
|
||||
for (const tsdoc of tsdocs) {
|
||||
tsdoc.endAt = (this.tdoc.duration && tsdoc.startAt) ? moment(tsdoc.startAt).add(this.tdoc.duration, 'hours').toDate() : null;
|
||||
}
|
||||
const udict = await user.getListForRender(domainId, [this.tdoc.owner, ...tsdocs.map((i) => i.uid)]);
|
||||
this.response.body = { tdoc: this.tdoc, tsdocs, udict };
|
||||
this.response.pjax = 'partials/contest_user.html';
|
||||
|
||||
@@ -36,7 +36,7 @@ export class HomeHandler extends Handler {
|
||||
uids = new Set<number>();
|
||||
|
||||
collectUser(uids: number[]) {
|
||||
uids.forEach((uid) => this.uids.add(uid));
|
||||
for (const uid of uids) this.uids.add(uid);
|
||||
}
|
||||
|
||||
async getHomework(domainId: string, limit = 5) {
|
||||
|
||||
Reference in new issue
Block a user