core&ui: bug fixes

This commit is contained in:
undefined committed 2025-06-30 22:02:50 +08:00
1 parent fb2a522eaa
commit 20686ca263
6 files changed
+10 -8

No files matched your search

+1 -1
View File
@@ -211,7 +211,7 @@ export class ContestProblemListHandler extends ContestDetailBaseHandler {
if (contest.isDone(this.tdoc) && canViewRecord) {
const correction = await problem.getListStatus(domainId, this.user._id, this.tdoc.pids);
for (const pid in correction) {
if (this.tsdoc.detail[pid]?.rid === correction[pid].rid) delete correction[pid];
if (this.tsdoc.detail?.[pid]?.rid === correction[pid].rid) delete correction[pid];
}
rids.push(...Object.values(correction).map((i) => i.rid));
this.response.body.correction = correction;
+2 -3
View File
@@ -43,12 +43,11 @@ export class FilesHandler extends Handler {
}
}
@param('uid', Types.Int, true)
async get({ }, uid: number) {
async get({ }) {
if (!this.udoc._files?.length) this.checkPriv(PRIV.PRIV_CREATE_FILE);
this.response.body = {
files: sortFiles(this.udoc._files),
urlForFile: (filename: string) => this.url('fs_download', { uid, filename }),
urlForFile: (filename: string) => this.url('fs_download', { uid: this.udoc._id, filename }),
};
this.response.pjax = 'partials/files.html';
this.response.template = 'home_files.html';