From 928539b5f0fa5847f01995eb35781f43345b61e1 Mon Sep 17 00:00:00 2001 From: Maria D'Costa Date: Mon, 27 Mar 2023 09:57:02 +0000 Subject: [PATCH 1/2] Use constant --- src/libs/actions/Policy.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index f1cbb66cbdeb..4fa82b02e723 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -508,7 +508,7 @@ function hideWorkspaceAlertMessage(policyID) { function updateWorkspaceCustomUnit(policyID, currentCustomUnit, newCustomUnit, lastModified) { const optimisticData = [ { - onyxMethod: 'merge', + onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { customUnits: { @@ -523,7 +523,7 @@ function updateWorkspaceCustomUnit(policyID, currentCustomUnit, newCustomUnit, l const successData = [ { - onyxMethod: 'merge', + onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { customUnits: { @@ -538,7 +538,7 @@ function updateWorkspaceCustomUnit(policyID, currentCustomUnit, newCustomUnit, l const failureData = [ { - onyxMethod: 'merge', + onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { customUnits: { @@ -572,7 +572,7 @@ function updateWorkspaceCustomUnit(policyID, currentCustomUnit, newCustomUnit, l function updateCustomUnitRate(policyID, currentCustomUnitRate, customUnitID, newCustomUnitRate, lastModified) { const optimisticData = [ { - onyxMethod: 'merge', + onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { customUnits: { @@ -592,7 +592,7 @@ function updateCustomUnitRate(policyID, currentCustomUnitRate, customUnitID, new const successData = [ { - onyxMethod: 'merge', + onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { customUnits: { @@ -610,7 +610,7 @@ function updateCustomUnitRate(policyID, currentCustomUnitRate, customUnitID, new const failureData = [ { - onyxMethod: 'merge', + onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, value: { customUnits: { From 031d9a23c0306f5d3c555c9952745b3ae4322cb7 Mon Sep 17 00:00:00 2001 From: Maria D'Costa Date: Mon, 27 Mar 2023 10:19:32 +0000 Subject: [PATCH 2/2] Remove duplicate custom unit error --- src/libs/actions/Policy.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index 4fa82b02e723..3450cc6bdde3 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -546,9 +546,6 @@ function updateWorkspaceCustomUnit(policyID, currentCustomUnit, newCustomUnit, l customUnitID: currentCustomUnit.customUnitID, name: currentCustomUnit.name, attributes: currentCustomUnit.attributes, - errors: { - [DateUtils.getMicroseconds()]: Localize.translateLocal('workspace.reimburse.updateCustomUnitError'), - }, }, }, },