In my project, I'm trying to save actions that made by users for audit purpose, ex: creating new items, delete smth etc. I'm using postgresql and typeorm. let's say I have history
table to save this. this table contains following columns:
id, description, author_id, track_id, track_type, metadata
.
here track_type
can be users, groups, items.
My question is: how can i save info in description
column some dynamic variables. Example:
Изменён период обучения ученика Richard L. с уч. единицей Group Big Apple From 1/28/2025 - 9/30/2025 to 11/1/2024 - 9/30/2025
here Richard L.
is link to the users profile and Group Big Apple
is link to the groups details page. when user's name or group's name changed, thay are also be changed in history
.
I tried to save that name's id in html tag(<a href='groups/1'>{groupName}</a>
) and put placeholder for name, and their ids in metadata
. but i have no idea how to change placeholders while getting data from history
table.