Fixed collection deletion

This commit is contained in:
Jori Lallo
2018-01-28 17:04:53 -08:00
parent 2a716f55a9
commit 5ab423108a
2 changed files with 37 additions and 8 deletions

View File

@@ -95,6 +95,14 @@ Collection.associate = models => {
});
};
Collection.addHook('afterDestroy', async model => {
await Document.destroy({
where: {
atlasId: model.id,
},
});
});
// Hooks
Collection.addHook('afterCreate', model =>