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

Method delTestdata

packages/hydrooj/src/model/problem.ts:326–333  ·  view source on GitHub ↗
(domainId: string, pid: number, name: string | string[], operator = 1)

Source from the content-addressed store, hash-verified

324 }
325
326 static async delTestdata(domainId: string, pid: number, name: string | string[], operator = 1) {
327 const names = (name instanceof Array) ? name : [name];
328 await Promise.all([
329 storage.del(names.map((t) => `problem/${domainId}/${pid}/testdata/${t}`), operator),
330 ProblemModel.pull(domainId, pid, 'data', names),
331 ]);
332 await bus.emit('problem/delTestdata', domainId, pid, names);
333 }
334
335 static async addAdditionalFile(
336 domainId: string, pid: number, name: string,

Callers 2

renameTestdataMethod · 0.80
postDeleteFilesMethod · 0.80

Calls 3

pullMethod · 0.80
allMethod · 0.45
delMethod · 0.45

Tested by

no test coverage detected