mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 05:26:17 +00:00
Rename method from default to primary.
This commit is contained in:
@@ -126,7 +126,7 @@ class ShowController extends Controller
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function showDefault(): JsonResponse
|
||||
public function showPrimary(): JsonResponse
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
|
||||
@@ -73,7 +73,7 @@ class StoreController extends Controller
|
||||
{
|
||||
$currency = $this->repository->store($request->getAll());
|
||||
if (true === $request->boolean('default')) {
|
||||
$this->repository->makeDefault($currency);
|
||||
$this->repository->makePrimary($currency);
|
||||
app('preferences')->mark();
|
||||
}
|
||||
$manager = $this->getManager();
|
||||
|
||||
@@ -101,12 +101,12 @@ class UpdateController extends Controller
|
||||
/**
|
||||
* @throws FireflyException
|
||||
*/
|
||||
public function makeDefault(TransactionCurrency $currency): JsonResponse
|
||||
public function makePrimary(TransactionCurrency $currency): JsonResponse
|
||||
{
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
$this->repository->enable($currency);
|
||||
$this->repository->makeDefault($currency);
|
||||
$this->repository->makePrimary($currency);
|
||||
|
||||
app('preferences')->mark();
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ class NewUserController extends Controller
|
||||
$this->createCashWalletAccount($currency, $language); // create cash wallet account
|
||||
|
||||
// store currency preference:
|
||||
$currencyRepository->makeDefault($currency);
|
||||
$currencyRepository->makePrimary($currency);
|
||||
|
||||
// store frontpage preferences:
|
||||
$accounts = $this->repository->getAccountsByType([AccountTypeEnum::ASSET->value])->pluck('id')->toArray();
|
||||
|
||||
@@ -417,7 +417,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
|
||||
|
||||
// currency must be made default.
|
||||
if (true === $default) {
|
||||
$this->makeDefault($currency);
|
||||
$this->makePrimary($currency);
|
||||
}
|
||||
|
||||
/** @var CurrencyUpdateService $service */
|
||||
@@ -426,7 +426,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface, UserGroupInterf
|
||||
return $service->update($currency, $data);
|
||||
}
|
||||
|
||||
public function makeDefault(TransactionCurrency $currency): void
|
||||
public function makePrimary(TransactionCurrency $currency): void
|
||||
{
|
||||
$current = app('amount')->getPrimaryCurrencyByUserGroup($this->userGroup);
|
||||
Log::debug(sprintf('Enabled + made default currency %s for user #%d', $currency->code, $this->userGroup->id));
|
||||
|
||||
@@ -102,7 +102,7 @@ interface CurrencyRepositoryInterface
|
||||
|
||||
public function isFallbackCurrency(TransactionCurrency $currency): bool;
|
||||
|
||||
public function makeDefault(TransactionCurrency $currency): void;
|
||||
public function makePrimary(TransactionCurrency $currency): void;
|
||||
|
||||
public function searchCurrency(string $search, int $limit): Collection;
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ class UserGroupRepository implements UserGroupRepositoryInterface, UserGroupInte
|
||||
$currency = $repository->find((int) $data['primary_currency_id']);
|
||||
}
|
||||
if (null !== $currency) {
|
||||
$repository->makeDefault($currency);
|
||||
$repository->makePrimary($currency);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
|
||||
// currency must be made default.
|
||||
if (true === $default) {
|
||||
$this->makeDefault($currency);
|
||||
$this->makePrimary($currency);
|
||||
}
|
||||
|
||||
/** @var CurrencyUpdateService $service */
|
||||
@@ -374,7 +374,7 @@ class CurrencyRepository implements CurrencyRepositoryInterface
|
||||
return $service->update($currency, $data);
|
||||
}
|
||||
|
||||
public function makeDefault(TransactionCurrency $currency): void
|
||||
public function makePrimary(TransactionCurrency $currency): void
|
||||
{
|
||||
$current = app('amount')->getPrimaryCurrencyByUserGroup($this->userGroup);
|
||||
Log::debug(sprintf('Enabled + made default currency %s for user #%d', $currency->code, $this->userGroup->id));
|
||||
|
||||
@@ -89,7 +89,7 @@ interface CurrencyRepositoryInterface
|
||||
|
||||
public function isFallbackCurrency(TransactionCurrency $currency): bool;
|
||||
|
||||
public function makeDefault(TransactionCurrency $currency): void;
|
||||
public function makePrimary(TransactionCurrency $currency): void;
|
||||
|
||||
public function searchCurrency(string $search, int $limit): Collection;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user