Skip to content

Commit

Permalink
fix: Offline Currency Data Typing
Browse files Browse the repository at this point in the history
- Checking then unchecking the offline payout option in an add or edit
  currency modal will assign an empty string to the data model.
- The data model is typed as a Number.
- This typing is exposed to external scripts.
- So trim the null or empty string on addOrEditCurrency controller save
  to prevent a string from getting through.
- See issue crowbartools#2801.
  • Loading branch information
phroggster committed Sep 11, 2024
1 parent 1b8efce commit 6cba965
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@
return;
}

if (!$ctrl.currency.offline || $ctrl.currency.offline === "") {
$ctrl.currency.offline = undefined;
}

logger.debug($ctrl.currency);

const action = $ctrl.isNewCurrency ? "add" : "update";
Expand Down

0 comments on commit 6cba965

Please sign in to comment.