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

Method delAdditionalFile

packages/hydrooj/src/model/problem.ts:367–374  ·  view source on GitHub ↗
(domainId: string, pid: number, name: MaybeArray<string>, operator = 1)

Source from the content-addressed store, hash-verified

365 }
366
367 static async delAdditionalFile(domainId: string, pid: number, name: MaybeArray<string>, operator = 1) {
368 const names = (name instanceof Array) ? name : [name];
369 await Promise.all([
370 storage.del(names.map((t) => `problem/${domainId}/${pid}/additional_file/${t}`), operator),
371 ProblemModel.pull(domainId, pid, 'additional_file', names),
372 ]);
373 await bus.emit('problem/delAdditionalFile', domainId, pid, names);
374 }
375
376 static async random(domainId: string, query: Filter<ProblemDoc>) {
377 const pcount = await document.count(domainId, document.TYPE_PROBLEM, query);

Callers 2

renameAdditionalFileMethod · 0.80
postDeleteFilesMethod · 0.80

Calls 3

pullMethod · 0.80
allMethod · 0.45
delMethod · 0.45

Tested by

no test coverage detected