Covered the preferences controller.

This commit is contained in:
James Cole
2015-04-21 17:19:14 +02:00
parent 44056629e8
commit 0d3213a379
2 changed files with 87 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<?php namespace FireflyIII\Http\Controllers;
use Auth;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use Input;
use Preferences;
use Redirect;
@@ -28,9 +28,9 @@ class PreferencesController extends Controller
/**
* @return $this|\Illuminate\View\View
*/
public function index()
public function index(AccountRepositoryInterface $repository)
{
$accounts = Auth::user()->accounts()->accountTypeIn(['Default account', 'Asset account'])->orderBy('accounts.name', 'ASC')->get(['accounts.*']);
$accounts = $repository->getAccounts(['Default account', 'Asset account']);
$viewRange = Preferences::get('viewRange', '1M');
$viewRangeValue = $viewRange->data;
$frontPage = Preferences::get('frontPageAccounts', []);