mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 03:43:07 +00:00
Error handling for https://github.com/firefly-iii/firefly-iii/issues/5575
This commit is contained in:
@@ -83,14 +83,18 @@ class ReconcileController extends Controller
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function overview(Request $request, Account $account, Carbon $start, Carbon $end): JsonResponse
|
||||
public function overview(Request $request, Account $account = null, Carbon $start = null, Carbon $end = null): JsonResponse
|
||||
{
|
||||
$startBalance = $request->get('startBalance');
|
||||
$endBalance = $request->get('endBalance');
|
||||
$accountCurrency = $this->accountRepos->getAccountCurrency($account) ?? app('amount')->getDefaultCurrency();
|
||||
$amount = '0';
|
||||
$clearedAmount = '0';
|
||||
$route = '';
|
||||
|
||||
if (null === $start && null === $end) {
|
||||
throw new FireflyException('Invalid dates submitted.');
|
||||
}
|
||||
if ($end->lt($start)) {
|
||||
[$start, $end] = [$end, $start];
|
||||
}
|
||||
@@ -220,8 +224,11 @@ class ReconcileController extends Controller
|
||||
* @throws FireflyException
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function transactions(Account $account, Carbon $start, Carbon $end)
|
||||
public function transactions(Account $account, Carbon $start = null, Carbon $end = null)
|
||||
{
|
||||
if (null === $start || null === $end) {
|
||||
throw new FireflyException('Invalid dates submitted.');
|
||||
}
|
||||
if ($end->lt($start)) {
|
||||
[$end, $start] = [$start, $end];
|
||||
}
|
||||
|
Reference in New Issue
Block a user