Merge pull request #532 from outline/jori/collection-delete-fixes
Fixed collection deletion
This commit is contained in:
@@ -95,6 +95,14 @@ Collection.associate = models => {
|
||||
});
|
||||
};
|
||||
|
||||
Collection.addHook('afterDestroy', async model => {
|
||||
await Document.destroy({
|
||||
where: {
|
||||
atlasId: model.id,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
// Hooks
|
||||
|
||||
Collection.addHook('afterCreate', model =>
|
||||
|
||||
Reference in New Issue
Block a user