Skip to content

Commit

Permalink
Added fix for empty stings in a query (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
demianottema authored Apr 23, 2024
1 parent 4240ed5 commit 94082c1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Forms/Components/MoneyInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ protected function setUp(): void
return MoneyFormatter::formatAsDecimal($state, $currency, $locale);
});

$this->dehydrateStateUsing(function (MoneyInput $component, $state): string {

$this->dehydrateStateUsing(function (MoneyInput $component, $state): ?string {
$currency = $component->getCurrency();
$state = MoneyFormatter::parseDecimal($state, $currency, $component->getLocale());

$this->prepare();

if (empty($state)) {
return null;
}

return $state;
});
}
Expand Down

0 comments on commit 94082c1

Please sign in to comment.