mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: api: problem.manage.edit & problem.manage.delete
This commit is contained in:
1 parent
a75804362d
commit
5d9310fb78
7 files changed
+62
-15
No files matched your search
@@ -107,8 +107,8 @@ export function deleteOne<K extends keyof DocType>(
|
||||
domainId: string, docType: K, docId: DocType[K]['docId'],
|
||||
) {
|
||||
return Promise.all([
|
||||
collStatus.deleteMany({ domainId, docType, docId }),
|
||||
coll.deleteOne({ domainId, docType, docId }),
|
||||
collStatus.deleteMany({ domainId, docType, docId }),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ export class ProblemModel {
|
||||
bus.parallel('problem/delete', domainId, docId),
|
||||
]);
|
||||
await bus.emit('problem/del', domainId, docId);
|
||||
return res;
|
||||
return !!res[0][0].deletedCount;
|
||||
}
|
||||
|
||||
static async addTestdata(domainId: string, pid: number, name: string, f: Readable | Buffer | string) {
|
||||
|
||||
Reference in new issue
Block a user