MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / postDelete

Method postDelete

packages/hydrooj/src/handler/problem.ts:447–453  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 4

ownMethod · 0.80
checkPermMethod · 0.80
urlMethod · 0.80
delMethod · 0.45

Tested by

no test coverage detected