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

Method postDelete

packages/hydrooj/src/handler/problem.ts:237–250  ·  view source on GitHub ↗
(domainId: string, pids: number[])

Source from the content-addressed store, hash-verified

235
236 @param('pids', Types.NumericArray)
237 async postDelete(domainId: string, pids: number[]) {
238 let i = 0;
239 for (const pid of pids) {
240 // eslint-disable-next-line no-await-in-loop
241 const pdoc = await problem.get(domainId, pid);
242 if (!pdoc) continue;
243 if (!this.user.own(pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
244 // eslint-disable-next-line no-await-in-loop
245 await problem.del(domainId, pid);
246 i++;
247 this.progress('Deleting: ({0}/{1})', [i, pids.length]);
248 }
249 this.back();
250 }
251
252 @param('pids', Types.NumericArray)
253 async postHide(domainId: string, pids: number[]) {

Callers

nothing calls this directly

Calls 6

ownMethod · 0.80
checkPermMethod · 0.80
progressMethod · 0.80
backMethod · 0.80
getMethod · 0.45
delMethod · 0.45

Tested by

no test coverage detected