Merge pull request #532 from outline/jori/collection-delete-fixes

Fixed collection deletion
This commit is contained in:
Jori Lallo
2018-01-28 17:54:53 -08:00
committed by GitHub
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 =>