Skip to content

Commit

Permalink
clone newCustomUnit...
Browse files Browse the repository at this point in the history
Signed-off-by: Tsaqif <[email protected]>
  • Loading branch information
tsa321 committed Sep 20, 2023
1 parent 5733385 commit 5420435
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,15 +714,15 @@ function updateWorkspaceCustomUnitAndRate(policyID, currentCustomUnit, newCustom
},
];

const newCustomUnitParam = _.omit(newCustomUnit, ['pendingAction', 'errors']);
const newCustomUnitRateParam = _.omit(newCustomUnit.rates, ['pendingAction', 'errors']);
const newCustomUnitParam = _.clone(newCustomUnit);
newCustomUnitParam.rates = _.omit(newCustomUnitParam.rates, ['pendingAction', 'errors']);
API.write(
'UpdateWorkspaceCustomUnitAndRate',
{
policyID,
lastModified,
customUnit: JSON.stringify(newCustomUnitParam),
customUnitRate: JSON.stringify(newCustomUnitRateParam),
customUnitRate: JSON.stringify(newCustomUnitParam.rates),
},
{optimisticData, successData, failureData},
);
Expand Down

0 comments on commit 5420435

Please sign in to comment.