diff --git a/services/common/src/redux/selectors/staticContentSelectors.ts b/services/common/src/redux/selectors/staticContentSelectors.ts index bbc8c2357a..d5d26986ed 100644 --- a/services/common/src/redux/selectors/staticContentSelectors.ts +++ b/services/common/src/redux/selectors/staticContentSelectors.ts @@ -333,10 +333,8 @@ export const getHSRCMComplianceCodesHash = createSelector([getCurrentComplianceC .filter(({ article_act_code }) => article_act_code === "HSRCM") .reduce((map, code) => { const composedValue = formatComplianceCodeValueOrLabel(code, true); - return { - [code.compliance_article_id]: composedValue, - ...map, - }; + map[code.compliance_article_id] = composedValue; + return map; }, {}) ); diff --git a/services/common/src/redux/utils/helpers.ts b/services/common/src/redux/utils/helpers.ts index 3256cdfadf..6ab52e21d4 100644 --- a/services/common/src/redux/utils/helpers.ts +++ b/services/common/src/redux/utils/helpers.ts @@ -75,8 +75,12 @@ export const createDropDownList = ( }; // Function to create a hash given an array of values and labels -export const createLabelHash = (arr) => - arr.reduce((map, { value, label }) => ({ [value]: label, ...map }), {}); +export const createLabelHash = (arr) => { + return arr.reduce((map, { value, label }) => { + map[value] = label; + return map; + }, {}); +}; export const formatTractionDate = (dateString: string) => { const year = dateString.slice(0, 4);