core: unset record contest attr when deleting contest

This commit is contained in:
undefined committed 2022-03-23 15:40:23 +08:00
1 parent 375a06a98d
commit eeff671c3a
2 files changed
+2 -1

No files matched your search

+1
View File
@@ -137,6 +137,7 @@ 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 record.updateMulti(domainId, { domainId, contest: tid }, undefined, undefined, { contest: '' });
await TaskModel.deleteMany({
type: 'schedule', subType: 'contest', domainId, tid,
});