mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: 修复文件删除回显
This commit is contained in:
1 parent
df0982c690
commit
85b12f245d
4 files changed
+29
-25
No files matched your search
@@ -480,11 +480,8 @@ export class ProblemFilesHandler extends ProblemDetailHandler {
|
||||
@post('type', Types.Range(['testdata', 'additional_file']), true)
|
||||
async postDeleteFiles(domainId: string, files: string[], type = 'testdata') {
|
||||
if (this.pdoc.owner !== this.user._id) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
|
||||
if (type === 'testdata') {
|
||||
await problem.delTestdata(domainId, this.pdoc.docId, files);
|
||||
} else {
|
||||
await storage.del(files.map((file) => `problem/${this.pdoc.domainId}/${this.pdoc.docId}/${type}/${file}`));
|
||||
}
|
||||
if (type === 'testdata') await problem.delTestdata(domainId, this.pdoc.docId, files);
|
||||
else await problem.delAdditionalFile(domainId, this.pdoc.docId, files);
|
||||
this.back();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user