trigger runOnAttributeChange, runOnNoteChange on entity deletions as well

This commit is contained in:
azivner 2019-01-11 23:43:22 +01:00
parent 3c19a712c0
commit 581b1fdaa5

View file

@ -37,7 +37,7 @@ eventService.subscribe(eventService.NOTE_TITLE_CHANGED, async note => {
}
});
eventService.subscribe(eventService.ENTITY_CHANGED, async ({ entityName, entity }) => {
eventService.subscribe([ eventService.ENTITY_CHANGED, eventService.ENTITY_DELETED ], async ({ entityName, entity }) => {
if (entityName === 'attributes') {
await runAttachedRelations(await entity.getNote(), 'runOnAttributeChange', entity);
}