Refactor repository and some commands for upgrading

This commit is contained in:
James Cole
2023-10-22 07:51:26 +02:00
parent a810eb2cb5
commit 4cec0a9f97
6 changed files with 243 additions and 28 deletions

View File

@@ -52,14 +52,13 @@ class CurrencyUpdateService
$currency->name = e($data['name']);
}
if (array_key_exists('enabled', $data) && is_bool($data['enabled'])) {
$currency->enabled = (bool)$data['enabled'];
}
$currency->enabled = false;
if (array_key_exists('decimal_places', $data) && is_int($data['decimal_places'])) {
$currency->decimal_places = (int)$data['decimal_places'];
}
unset($currency->userEnabled);
unset($currency->userDefault);
$currency->save();
return $currency;