core: fix problem_files.git

This commit is contained in:
undefined committed 2021-05-06 18:31:50 +08:00
1 parent e89c5cd10e
commit a44055d54a
4 files changed
+5 -4

No files matched your search

+2 -2
View File
@@ -382,8 +382,8 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
@param('additional_file', Types.Boolean)
async get(domainId: string, getTestdata = true, getAdditionalFile = true) {
const canReadData = !this.user.own(this.pdoc) || this.user.hasPerm(PERM.PERM_READ_PROBLEM_DATA);
this.response.body.testdata = (getTestdata && canReadData) ? sortFiles(this.pdoc.data) : [];
this.response.body.additional_file = getAdditionalFile ? sortFiles(this.pdoc.additional_file) : [];
this.response.body.testdata = (getTestdata && canReadData) ? sortFiles(this.pdoc.data || []) : [];
this.response.body.additional_file = getAdditionalFile ? sortFiles(this.pdoc.additional_file || []) : [];
this.response.template = 'problem_files.html';
}