From df6d65aaa3618fd0080d712f6e70a6907a2ef62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Sandvik?= Date: Tue, 12 Sep 2023 10:45:13 +0200 Subject: [PATCH] chore: lint fix --- src/components/orgunits/OrgUnitData.js | 2 +- src/components/periods/PeriodSelect.js | 2 +- src/util/periods.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/orgunits/OrgUnitData.js b/src/components/orgunits/OrgUnitData.js index bce650e02..4108d34d1 100644 --- a/src/components/orgunits/OrgUnitData.js +++ b/src/components/orgunits/OrgUnitData.js @@ -23,7 +23,7 @@ const ORGUNIT_PROFILE_QUERY = { // Only YEARLY period type is supported in first version const periodType = 'YEARLY' const currentYear = String(new Date().getFullYear()) -const periods = getFixedPeriodsByType(periodType, currentYear) +const periods = getFixedPeriodsByType({ periodType, currentYear }) const defaultPeriod = filterFuturePeriods(periods)[0] || periods[0] /* diff --git a/src/components/periods/PeriodSelect.js b/src/components/periods/PeriodSelect.js index af567a0ac..54d0018ce 100644 --- a/src/components/periods/PeriodSelect.js +++ b/src/components/periods/PeriodSelect.js @@ -56,7 +56,7 @@ const PeriodSelect = ({ useEffect(() => { if (year && periodType) { setPeriods( - getFixedPeriodsByType(periodType, year, firstDate, lastDate) + getFixedPeriodsByType({ periodType, year, firstDate, lastDate }) ) } }, [year, periodType, firstDate, lastDate]) diff --git a/src/util/periods.js b/src/util/periods.js index 837e6153f..3eb40b367 100644 --- a/src/util/periods.js +++ b/src/util/periods.js @@ -16,12 +16,12 @@ const filterPeriods = (periods, firstDate, lastDate) => export const getPeriodTypes = (hiddenPeriods = []) => periodTypes().filter(({ group }) => !hiddenPeriods.includes(group)) -export const getFixedPeriodsByType = ( +export const getFixedPeriodsByType = ({ periodType, year, firstDate, - lastDate -) => { + lastDate, +}) => { const period = getFixedPeriodsOptionsById(periodType) const forceDescendingForYearTypes = !!periodType.match(/^FY|YEARLY/)