(domainId: string, docId: number)
| 280 | } |
| 281 | |
| 282 | static async del(domainId: string, docId: number) { |
| 283 | await bus.parallel('problem/before-del', domainId, docId); |
| 284 | const res = await Promise.all([ |
| 285 | document.deleteOne(domainId, document.TYPE_PROBLEM, docId), |
| 286 | document.deleteMultiStatus(domainId, document.TYPE_PROBLEM, { docId }), |
| 287 | storage.list(`problem/${domainId}/${docId}/`) |
| 288 | .then((items) => storage.del(items.map((item) => `problem/${domainId}/${docId}/${item.name}`))), |
| 289 | bus.parallel('problem/delete', domainId, docId), |
| 290 | ]); |
| 291 | return !!res[0][0].deletedCount; |
| 292 | } |
| 293 | |
| 294 | static async addTestdata(domainId: string, pid: number, name: string, f: Readable | Buffer | string, operator = 1) { |
| 295 | name = name.trim(); |
no test coverage detected