core: add domain delete

This commit is contained in:
undefined committed 2021-05-25 23:16:27 +08:00
1 parent 71f86cf79b
commit ef73b97089
8 files changed
+23 -2

No files matched your search

+5
View File
@@ -428,6 +428,11 @@ async function ensureIndexes() {
}
bus.once('app/started', ensureIndexes);
bus.on('domain/delete', (domainId) => Promise.all([
coll.deleteMany({ domainId }),
collStatus.deleteMany({ domainId }),
]));
global.Hydro.model.document = {
coll,
collStatus,