mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-08-29 01:13:08 +00:00
Clean up API references.
This commit is contained in:
@@ -37,7 +37,6 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use League\Fractal\Resource\Item;
|
||||
use League\Fractal\Serializer\JsonApiSerializer;
|
||||
use Preferences;
|
||||
|
||||
/**
|
||||
* Class AccountController
|
||||
@@ -104,7 +103,7 @@ class AccountController extends Controller
|
||||
|
||||
// types to get, page size:
|
||||
$types = $this->mapTypes($this->parameters->get('type'));
|
||||
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
|
||||
// get list of accounts. Count it and split it.
|
||||
$collection = $this->repository->getAccountsByType($types);
|
||||
|
@@ -37,7 +37,6 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use League\Fractal\Resource\Item;
|
||||
use League\Fractal\Serializer\JsonApiSerializer;
|
||||
use Preferences;
|
||||
|
||||
/**
|
||||
* Class BillController
|
||||
@@ -89,7 +88,7 @@ class BillController extends Controller
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$paginator = $this->repository->getPaginator($pageSize);
|
||||
/** @var Collection $bills */
|
||||
$bills = $paginator->getCollection();
|
||||
|
@@ -38,7 +38,6 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use League\Fractal\Resource\Item;
|
||||
use League\Fractal\Serializer\JsonApiSerializer;
|
||||
use Preferences;
|
||||
|
||||
/**
|
||||
* Class CurrencyController
|
||||
@@ -101,7 +100,7 @@ class CurrencyController extends Controller
|
||||
*/
|
||||
public function index(Request $request): JsonResponse
|
||||
{
|
||||
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$collection = $this->repository->get();
|
||||
$count = $collection->count();
|
||||
// slice them:
|
||||
@@ -157,8 +156,8 @@ class CurrencyController extends Controller
|
||||
$currency = $this->repository->store($request->getAll());
|
||||
|
||||
if ($request->boolean('default') === true) {
|
||||
Preferences::set('currencyPreference', $currency->code);
|
||||
Preferences::mark();
|
||||
app('preferences')->set('currencyPreference', $currency->code);
|
||||
app('preferences')->mark();
|
||||
}
|
||||
if (null !== $currency) {
|
||||
$manager = new Manager();
|
||||
@@ -188,8 +187,8 @@ class CurrencyController extends Controller
|
||||
$currency = $this->repository->update($currency, $data);
|
||||
|
||||
if ($request->boolean('default') === true) {
|
||||
Preferences::set('currencyPreference', $currency->code);
|
||||
Preferences::mark();
|
||||
app('preferences')->set('currencyPreference', $currency->code);
|
||||
app('preferences')->mark();
|
||||
}
|
||||
|
||||
$manager = new Manager();
|
||||
|
@@ -40,7 +40,6 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use League\Fractal\Serializer\JsonApiSerializer;
|
||||
use Log;
|
||||
use Preferences;
|
||||
|
||||
/**
|
||||
* Class TransactionController
|
||||
@@ -92,7 +91,7 @@ class TransactionController extends Controller
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
|
||||
// read type from URI
|
||||
$type = $request->get('type') ?? 'default';
|
||||
|
@@ -36,7 +36,6 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
|
||||
use League\Fractal\Resource\Collection as FractalCollection;
|
||||
use League\Fractal\Resource\Item;
|
||||
use League\Fractal\Serializer\JsonApiSerializer;
|
||||
use Preferences;
|
||||
|
||||
|
||||
/**
|
||||
@@ -94,7 +93,7 @@ class UserController extends Controller
|
||||
public function index(Request $request)
|
||||
{
|
||||
// user preferences
|
||||
$pageSize = (int)Preferences::getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
$pageSize = (int)app('preferences')->getForUser(auth()->user(), 'listPageSize', 50)->data;
|
||||
|
||||
// make manager
|
||||
$manager = new Manager();
|
||||
|
Reference in New Issue
Block a user