Skip to content

Commit

Permalink
chore: minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Jan 22, 2024
1 parent 9351aa5 commit 1540e45
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/Dialogs/PeriodDimension/PeriodDimension.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,27 +123,27 @@ export const PeriodDimension = ({ dimension, onClose }) => {
: OPTION_PRESETS
)

const inputType = useSelector(sGetUiInputType)
const outputType = useSelector(sGetUiInputType)

const { programId } = extractDimensionIdParts(dimension.id, inputType)
const { programId } = extractDimensionIdParts(dimension.id, outputType)

const updatePeriodDimensionItems = (items) => {
const { uiItems, metadata } = items.reduce(
(acc, item) => {
const itemId = formatDimensionId({
const id = formatDimensionId({
dimensionId: item.id,
programId,
outputType: inputType,
outputType,
})
acc.uiItems.push(itemId)
acc.uiItems.push(id)

if (isStartEndDate(item.id)) {
acc.metadata[itemId] = {
id: itemId,
acc.metadata[id] = {
id,
name: formatStartEndDate(item.id),
}
} else {
acc.metadata[itemId] = { ...item, id: itemId }
acc.metadata[id] = { ...item, id }
}

return acc
Expand Down

0 comments on commit 1540e45

Please sign in to comment.