(logsSnapshot, usersMap, tasksMap)
| 110 | } |
| 111 | |
| 112 | function formatTaskRequestsLogs(logsSnapshot, usersMap, tasksMap) { |
| 113 | const { meta, body } = logsSnapshot; |
| 114 | const formattedData = flattenObject(logsSnapshot); |
| 115 | return { |
| 116 | user: usersMap[meta.lastModifiedBy]?.username, |
| 117 | taskId: meta.taskId, |
| 118 | taskTitle: tasksMap[body.taskId]?.title, |
| 119 | proposedStartDate: formattedData.users[0].proposedStartDate, |
| 120 | proposedDeadline: formattedData.users[0].proposedDeadline, |
| 121 | ..._.omit(formattedData, "users"), |
| 122 | }; |
| 123 | } |
| 124 | |
| 125 | function flattenObject(obj, prefix = "") { |
| 126 | const result = Object.create(null); |
no test coverage detected