kibae / typeorm-auditing

TypeORM Auditing: Create history tables and manage changes of entity automatically.
https://www.npmjs.com/package/typeorm-auditing
MIT License
25 stars 3 forks source link

[Question] Deleting an entity and storing additional information #16

Open PikkaPikkachu opened 1 year ago

PikkaPikkachu commented 1 year ago

Context

We are trying to populate additional information for modifiedBy in the auditing entity like so, it gets updated fine when creating or updating the entity, but during deletion, the modifyingUserId doesn't get populated, our guess is that it is because of this logic in the library.

Question

We are wondering, why are we saving the event.databaseEntity instead of event.entity during deletion, while it's different for all the save/create operations and if it would be possible to change it to event.entity during deletion as well ?

Thanks for any help with this!