chore: Automatically remove policy from memory when associated model is deleted

This commit is contained in:
Tom Moor
2023-12-29 09:20:44 -05:00
parent 8d74028f93
commit 08a787082f
2 changed files with 5 additions and 2 deletions

View File

@@ -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);
}