(domainId: string, pid: number, name: MaybeArray<string>, operator = 1)
| 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); |
no test coverage detected