Closed HernanRivasAcosta closed 8 years ago
@HernanRivasAcosta can you fix the link? It's pointing to an unrelated line in code.
In order to avoid overhead, the fix should be to send the event "persisted" when users creates or updates an entity
@llamallamaduck since you have been working with those events, what do you think about this change?
It seems ok to me if there is no other way of knowing whether the thing is updated or stored for the first time. Is there any other way to get that information?
I was using these for the wombat plugin, and changing this will not have too much impact on its code. On the other hand, I do not know how useful is it for the user to know whether the thing was newly created or just updated? I am guessing it would be nice to know though.
If you call
sumo:persist
and the data to persist already has an id, sumo just assumes it's updating, not creating it. As seen here, it fires an event according to this logic.