create new runOnNoteContentChange event, #3436

This commit is contained in:
zadam
2022-12-18 23:53:47 +01:00
parent e41104208a
commit 5413a1aa79
5 changed files with 28 additions and 5 deletions

View File

@@ -58,6 +58,12 @@ eventService.subscribe([ eventService.ENTITY_CHANGED, eventService.ENTITY_DELETE
}
});
eventService.subscribe(eventService.ENTITY_CHANGED, ({entityName, entity}) => {
if (entityName === 'note_contents') {
runAttachedRelations(entity, 'runOnNoteContentChange', entity);
}
});
eventService.subscribe(eventService.ENTITY_CREATED, ({ entityName, entity }) => {
if (entityName === 'attributes') {
runAttachedRelations(entity.getNote(), 'runOnAttributeCreation', entity);