Skip to content

Commit 21b84d0

Browse files
committed
wip
1 parent 146d094 commit 21b84d0

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/commands/analytics.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -112,26 +112,26 @@ async function fetchOrgAnalyticsData (time: string, spinner: Ora, apiKey: string
112112

113113
spinner.stop()
114114

115-
const data = result.data.reduce((acc: { [key: string]: any }, current) => {
116-
const formattedDate = new Date(current.created_at).toLocaleDateString()
117-
118-
if (acc[formattedDate]) {
119-
acc[formattedDate].total_critical_alerts += current.total_critical_alerts
120-
acc[formattedDate].total_high_alerts += current.total_high_alerts
121-
acc[formattedDate].total_critical_added += current.total_critical_added
122-
acc[formattedDate].total_high_added += current.total_high_added
123-
acc[formattedDate].total_critical_prevented += current.total_critical_prevented
124-
acc[formattedDate].total_high_prevented += current.total_high_prevented
125-
acc[formattedDate].total_medium_prevented += current.total_medium_prevented
126-
acc[formattedDate].total_low_prevented += current.total_low_prevented
127-
// acc[formattedDate].top_five_alert_types += current.top_five_alert_types
128-
} else {
129-
acc[formattedDate] = current
130-
acc[formattedDate].created_at = formattedDate
131-
}
132-
133-
return acc
134-
}, {})
115+
// const data = result.data.reduce((acc: { [key: string]: any }, current) => {
116+
// const formattedDate = new Date(current.created_at).toLocaleDateString()
117+
118+
// if (acc[formattedDate]) {
119+
// acc[formattedDate].total_critical_alerts += current.total_critical_alerts
120+
// acc[formattedDate].total_high_alerts += current.total_high_alerts
121+
// acc[formattedDate].total_critical_added += current.total_critical_added
122+
// acc[formattedDate].total_high_added += current.total_high_added
123+
// acc[formattedDate].total_critical_prevented += current.total_critical_prevented
124+
// acc[formattedDate].total_high_prevented += current.total_high_prevented
125+
// acc[formattedDate].total_medium_prevented += current.total_medium_prevented
126+
// acc[formattedDate].total_low_prevented += current.total_low_prevented
127+
// // acc[formattedDate].top_five_alert_types += current.top_five_alert_types
128+
// } else {
129+
// acc[formattedDate] = current
130+
// acc[formattedDate].created_at = formattedDate
131+
// }
132+
133+
// return acc
134+
// }, {})
135135

136136
// console.log(data)
137137

0 commit comments

Comments
 (0)