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

Method postHide

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

Source from the content-addressed store, hash-verified

251
252 @param('pids', Types.NumericArray)
253 async postHide(domainId: string, pids: number[]) {
254 for (const pid of pids) {
255 // eslint-disable-next-line no-await-in-loop
256 const pdoc = await problem.get(domainId, pid);
257 if (!pdoc) throw new ProblemNotFoundError(domainId, pid);
258 if (!this.user.own(pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
259 // eslint-disable-next-line no-await-in-loop
260 await problem.edit(domainId, pid, { hidden: true });
261 }
262 this.back();
263 }
264
265 @param('pids', Types.NumericArray)
266 async postUnhide(domainId: string, pids: number[]) {

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