mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +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;
|
||||
|
||||
|
@@ -617,15 +617,14 @@ Route::group(
|
||||
static function (): void {
|
||||
Route::get('', ['uses' => 'ShowController@index', 'as' => 'index']);
|
||||
Route::post('', ['uses' => 'StoreController@store', 'as' => 'store']);
|
||||
Route::get('default', ['uses' => 'ShowController@showDefault', 'as' => 'show.default']);
|
||||
Route::get('native', ['uses' => 'ShowController@showDefault', 'as' => 'show.native']);
|
||||
Route::get('primary', ['uses' => 'ShowController@showPrimary', 'as' => 'show.primary']);
|
||||
Route::get('{currency_code}', ['uses' => 'ShowController@show', 'as' => 'show']);
|
||||
Route::put('{currency_code?}', ['uses' => 'UpdateController@update', 'as' => 'update']);
|
||||
Route::delete('{currency_code}', ['uses' => 'DestroyController@destroy', 'as' => 'delete']);
|
||||
|
||||
Route::post('{currency_code}/enable', ['uses' => 'UpdateController@enable', 'as' => 'enable']);
|
||||
Route::post('{currency_code}/disable', ['uses' => 'UpdateController@disable', 'as' => 'disable']);
|
||||
Route::post('{currency_code}/default', ['uses' => 'UpdateController@makeDefault', 'as' => 'default']);
|
||||
Route::post('{currency_code}/primary', ['uses' => 'UpdateController@makePrimary', 'as' => 'update.primary']);
|
||||
|
||||
Route::get('{currency_code}/accounts', ['uses' => 'ListController@accounts', 'as' => 'accounts']);
|
||||
Route::get('{currency_code}/available-budgets', ['uses' => 'ListController@availableBudgets', 'as' => 'available-budgets']);
|
||||
|
Reference in New Issue
Block a user