mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-17 17:57:09 +00:00
Refactor methods that request the old currency preference.
This commit is contained in:
@@ -56,13 +56,11 @@ class JavascriptController extends Controller
|
||||
*/
|
||||
public function accounts(AccountRepositoryInterface $repository, CurrencyRepositoryInterface $currencyRepository): Response
|
||||
{
|
||||
$accounts = $repository->getAccountsByType(
|
||||
$accounts = $repository->getAccountsByType(
|
||||
[AccountType::DEFAULT, AccountType::ASSET, AccountType::DEBT, AccountType::LOAN, AccountType::MORTGAGE, AccountType::CREDITCARD]
|
||||
);
|
||||
$preference = app('preferences')->get('currencyPreference', config('firefly.default_currency', 'EUR'));
|
||||
$default = $currencyRepository->findByCodeNull((string)$preference->data);
|
||||
|
||||
$data = ['accounts' => []];
|
||||
$default = app('amount')->getDefaultCurrency();
|
||||
$data = ['accounts' => []];
|
||||
|
||||
/** @var Account $account */
|
||||
foreach ($accounts as $account) {
|
||||
|
@@ -114,7 +114,7 @@ class NewUserController extends Controller
|
||||
$this->createCashWalletAccount($currency, $language); // create cash wallet account
|
||||
|
||||
// store currency preference:
|
||||
app('preferences')->set('currencyPreference', $currency->code);
|
||||
$currencyRepository->makeDefault($currency);
|
||||
|
||||
// store frontpage preferences:
|
||||
$accounts = $this->repository->getAccountsByType([AccountType::ASSET])->pluck('id')->toArray();
|
||||
|
Reference in New Issue
Block a user