| 445 | } |
| 446 | |
| 447 | async postDelete() { |
| 448 | if (!this.user.own(this.pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) this.checkPerm(PERM.PERM_EDIT_PROBLEM); |
| 449 | const tdocs = await contest.getRelated(this.args.domainId, this.pdoc.docId); |
| 450 | if (tdocs.length) throw new ProblemAlreadyUsedByContestError(this.pdoc.docId, tdocs[0]._id); |
| 451 | await problem.del(this.pdoc.domainId, this.pdoc.docId); |
| 452 | this.response.redirect = this.url('problem_main'); |
| 453 | } |
| 454 | |
| 455 | @param('star', Types.Boolean) |
| 456 | async postStar(domainId: string, star: boolean) { |