Skip to content

Commit

Permalink
Merge pull request #42966 from GandalfGwaihir/issue42556
Browse files Browse the repository at this point in the history
[Fix]: Saving tax name without altering displays error message
  • Loading branch information
arosiclair authored Jun 3, 2024
2 parents 053bd17 + ac1dc11 commit d1eadfc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/workspace/taxes/NamePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ function NamePage({
const goBack = useCallback(() => Navigation.goBack(ROUTES.WORKSPACE_TAX_EDIT.getRoute(policyID ?? '', taxID)), [policyID, taxID]);

const submit = () => {
renamePolicyTax(policyID, taxID, name);
const taxName = name.trim();
// Do not call the API if the edited tax name is the same as the current tag name
if (currentTaxRate?.name !== taxName) {
renamePolicyTax(policyID, taxID, taxName);
}
goBack();
};

Expand Down

0 comments on commit d1eadfc

Please sign in to comment.