mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-14 21:58:14 +00:00
Allow report options to be pulled using AJAX. Ajax is cool.
This commit is contained in:
@@ -23,6 +23,7 @@ use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
|
||||
use Illuminate\Support\Collection;
|
||||
use Preferences;
|
||||
use Response;
|
||||
use Session;
|
||||
use Steam;
|
||||
use View;
|
||||
@@ -85,6 +86,23 @@ class ReportController extends Controller
|
||||
return view('reports.index', compact('months', 'accounts', 'start', 'accountList', 'customFiscalYear'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $reportType
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function options(string $reportType)
|
||||
{
|
||||
$result = false;
|
||||
switch ($reportType) {
|
||||
default:
|
||||
$result = $this->noReportOptions();
|
||||
break;
|
||||
}
|
||||
|
||||
return Response::json($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $reportType
|
||||
* @param Carbon $start
|
||||
@@ -292,4 +310,12 @@ class ReportController extends Controller
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
private function noReportOptions(): array
|
||||
{
|
||||
return ['html' => view('reports.options.no-options')->render()];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user