| 99 | } |
| 100 | |
| 101 | function formatProfileDiffLogs(logsSnapshot, usersMap, type) { |
| 102 | const { meta, body } = logsSnapshot; |
| 103 | const actionKey = type === logType.PROFILE_DIFF_APPROVED ? "approvedBy" : "rejectedBy"; |
| 104 | return { |
| 105 | user: usersMap[meta.userId]?.username, |
| 106 | message: body.message, |
| 107 | // eslint-disable-next-line security/detect-object-injection |
| 108 | [actionKey]: usersMap[meta[actionKey]]?.username, |
| 109 | }; |
| 110 | } |
| 111 | |
| 112 | function formatTaskRequestsLogs(logsSnapshot, usersMap, tasksMap) { |
| 113 | const { meta, body } = logsSnapshot; |