mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-22 12:11:19 +00:00
Moved some JSON around. [skip-ci]
This commit is contained in:
@@ -1,15 +1,23 @@
|
||||
<?php
|
||||
|
||||
use Firefly\Storage\Account\AccountRepositoryInterface as ARI;
|
||||
use Firefly\Storage\Budget\BudgetRepositoryInterface as Bud;
|
||||
use Firefly\Storage\Category\CategoryRepositoryInterface as Cat;
|
||||
use Firefly\Storage\Component\ComponentRepositoryInterface as CRI;
|
||||
|
||||
class JsonController extends BaseController
|
||||
{
|
||||
protected $accounts;
|
||||
protected $components;
|
||||
protected $categories;
|
||||
protected $budgets;
|
||||
|
||||
public function __construct(ARI $accounts,CRI $components)
|
||||
public function __construct(ARI $accounts, CRI $components, Cat $categories, Bud $budgets)
|
||||
{
|
||||
$this->components = $components;
|
||||
$this->accounts = $accounts;
|
||||
$this->categories = $categories;
|
||||
$this->budgets = $budgets;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -32,7 +40,13 @@ class JsonController extends BaseController
|
||||
*/
|
||||
public function categories()
|
||||
{
|
||||
$list = $this->components->get();
|
||||
$list = $this->categories->get();
|
||||
$return = [];
|
||||
foreach ($list as $entry) {
|
||||
$return[] = $entry->name;
|
||||
}
|
||||
|
||||
return Response::json($return);
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user