show username instead of uid on history
This commit is contained in:
Barış Soner Uşaklı
2023-04-11 15:52:33 -04:00
parent 6eb1dd8687
commit 59b149784f

View File

@@ -770,6 +770,13 @@ Flags.getHistory = async function (flagId) {
}; };
}); });
// turn assignee uids into usernames
await Promise.all(history.map(async (entry) => {
if (entry.fields.hasOwnProperty('assignee')) {
entry.fields.assignee = await user.getUserField(entry.fields.assignee, 'username');
}
}));
// Append ban history and username change data // Append ban history and username change data
history = await mergeBanHistory(history, targetUid, uids); history = await mergeBanHistory(history, targetUid, uids);
history = await mergeMuteHistory(history, targetUid, uids); history = await mergeMuteHistory(history, targetUid, uids);