Open lzkill opened 1 year ago
Hello, @lzkill In general, it is assumed that the origin entity has the information of the first creator and the last updater.
However, I hope that your idea will come true. I'll think about a method, but it will require additional code to use. Please let me know if you have any good ideas for implementation. 🙏
Hi, @kibae!
What I see is people adding non-column attributes to the entity and populating it before save. This way the additional info is available at the subscriber.
I've also seen something using the event.queryRunner.data
, like here.
Oh, I'll take a look. Thanks @lzkill 😀
https://github.com/typeorm/typeorm/issues/4537 demonstrates how to pass metadata that can be used within the subscriber. This, combined, with updating AuditingSubscriber.saveHistory()
to use the entity fields might solve this problem without adding additional columns to the audited data model.
The docs say something about cuatom vars in the auditing entity, but how can I populate such a variable with the request userId?