Skip to content

Commit

Permalink
Sending all custom units attributes when updating the distance rate
Browse files Browse the repository at this point in the history
  • Loading branch information
rlinoz committed Jun 6, 2024
1 parent da2949f commit d22eacf
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ function PolicyDistanceRatesSettingsPage({policy, policyCategories, route}: Poli
const errorFields = customUnits[customUnitID]?.errorFields;

const setNewUnit = (unit: UnitItemType) => {
DistanceRate.setPolicyDistanceRatesUnit(policyID, customUnit, {...customUnit, attributes: {unit: unit.value}});
const attributes = {...customUnits[customUnitID].attributes, unit: unit.value};
DistanceRate.setPolicyDistanceRatesUnit(policyID, customUnit, {...customUnit, attributes});
};

const setNewCategory = (category: ListItem) => {
Expand Down

0 comments on commit d22eacf

Please sign in to comment.