Skip to content

Commit

Permalink
Merge pull request #16564 from Expensify/maria-fix-dupe-error-workspa…
Browse files Browse the repository at this point in the history
…ce-units

Remove duplicate error message for UpdateWorkspaceCustomUnit
  • Loading branch information
AndrewGable authored Apr 17, 2023
2 parents c994994 + 5c3a6e8 commit c792447
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,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: {
Expand All @@ -530,7 +530,7 @@ function updateWorkspaceCustomUnit(policyID, currentCustomUnit, newCustomUnit, l

const successData = [
{
onyxMethod: 'merge',
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
customUnits: {
Expand All @@ -545,17 +545,14 @@ function updateWorkspaceCustomUnit(policyID, currentCustomUnit, newCustomUnit, l

const failureData = [
{
onyxMethod: 'merge',
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
customUnits: {
[currentCustomUnit.customUnitID]: {
customUnitID: currentCustomUnit.customUnitID,
name: currentCustomUnit.name,
attributes: currentCustomUnit.attributes,
errors: {
[DateUtils.getMicroseconds()]: Localize.translateLocal('workspace.reimburse.updateCustomUnitError'),
},
},
},
},
Expand All @@ -579,7 +576,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: {
Expand All @@ -599,7 +596,7 @@ function updateCustomUnitRate(policyID, currentCustomUnitRate, customUnitID, new

const successData = [
{
onyxMethod: 'merge',
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
customUnits: {
Expand All @@ -617,7 +614,7 @@ function updateCustomUnitRate(policyID, currentCustomUnitRate, customUnitID, new

const failureData = [
{
onyxMethod: 'merge',
onyxMethod: CONST.ONYX.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`,
value: {
customUnits: {
Expand Down

0 comments on commit c792447

Please sign in to comment.