Refactor methods that request the old currency preference.

This commit is contained in:
James Cole
2023-10-22 07:55:36 +02:00
parent 4cec0a9f97
commit 80237d8bc3
7 changed files with 46 additions and 62 deletions

View File

@@ -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) {