core: delete task when deleting contest

This commit is contained in:
undefined committed 2021-11-27 15:18:32 +08:00
1 parent 7cdd542ed1
commit c07bf9a845
2 files changed
+4 -1

No files matched your search

+3
View File
@@ -116,6 +116,9 @@ export class ContestDetailHandler extends Handler {
const tdoc = await contest.get(domainId, tid);
if (!this.user.own(tdoc)) this.checkPerm(PERM.PERM_EDIT_CONTEST);
await contest.del(domainId, tid);
await TaskModel.deleteMany({
type: 'schedule', subType: 'contest.problemHide', domainId, tid,
});
this.response.redirect = this.url('contest_main');
}
}