entity deleltion should not trigger ENTITY_CHANGED event, it should be separate event

This commit is contained in:
azivner 2018-08-28 23:17:56 +02:00
parent b009bcb6a0
commit 3bb021fba1

View file

@ -95,10 +95,13 @@ async function updateEntity(entity) {
});
}
await eventService.emit(eventService.ENTITY_CHANGED, {
entityName,
entity
});
// it seems to be better to handle deletion with a separate event
if (!entity.isDeleted) {
await eventService.emit(eventService.ENTITY_CHANGED, {
entityName,
entity
});
}
}
});
}