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

Method postUnhide

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

Source from the content-addressed store, hash-verified

264
265 @param('pids', Types.NumericArray)
266 async postUnhide(domainId: string, pids: number[]) {
267 for (const pid of pids) {
268 // eslint-disable-next-line no-await-in-loop
269 const pdoc = await problem.get(domainId, pid);
270 if (!pdoc) throw new ProblemNotFoundError(domainId, pid);
271 if (!this.user.own(pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
272 // eslint-disable-next-line no-await-in-loop
273 await problem.edit(domainId, pid, { hidden: false });
274 }
275 this.back();
276 }
277}
278
279export class ProblemRandomHandler extends Handler {

Callers

nothing calls this directly

Calls 5

ownMethod · 0.80
checkPermMethod · 0.80
backMethod · 0.80
getMethod · 0.45
editMethod · 0.45

Tested by

no test coverage detected