chore: Automatically remove policy from memory when associated model is deleted
This commit is contained in:
@@ -123,6 +123,11 @@ export default abstract class Store<T extends Model> {
|
||||
}
|
||||
});
|
||||
|
||||
// Remove associated policies automatically, not defined through Relation decorator.
|
||||
if (this.modelName !== "Policy") {
|
||||
this.rootStore.policies.remove(id);
|
||||
}
|
||||
|
||||
this.data.delete(id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user