Skip to content

Commit

Permalink
fix: use reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenrikoverland committed Nov 27, 2023
1 parent 2522598 commit 63d3e03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/analytics/Analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ const Analytics = ({ sectionKey }) => {
useAnalytics()

const handleStartAnalyticsTablesGeneration = () => {
const params = {}
for (const [key, { checked }] of Object.entries(checkboxes)) {
const params = checkboxes.reduce((obj, { key, checked }) => {
if (checked) {
params[key] = true
obj[key] = checked
}
}
return obj
}, {})
if (lastYears !== DEFAULT_LAST_YEARS) {
params[LAST_YEARS_INPUT_KEY] = lastYears
}
Expand Down

0 comments on commit 63d3e03

Please sign in to comment.