mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Prevent empty box.
This commit is contained in:
parent
dcf90b6159
commit
abf218fc21
@ -153,6 +153,12 @@ class BoxController extends Controller
|
|||||||
$incomes[$currencyId] = Amount::formatAnything($currency, $incomes[$currencyId] ?? '0', false);
|
$incomes[$currencyId] = Amount::formatAnything($currency, $incomes[$currencyId] ?? '0', false);
|
||||||
$expenses[$currencyId] = Amount::formatAnything($currency, $expenses[$currencyId] ?? '0', false);
|
$expenses[$currencyId] = Amount::formatAnything($currency, $expenses[$currencyId] ?? '0', false);
|
||||||
}
|
}
|
||||||
|
if (\count($sums) === 0) {
|
||||||
|
$currency = app('amount')->getDefaultCurrency();
|
||||||
|
$sums[$currency->id] = Amount::formatAnything($currency, '0', false);
|
||||||
|
$incomes[$currency->id] = Amount::formatAnything($currency, '0', false);
|
||||||
|
$expenses[$currency->id] = Amount::formatAnything($currency, '0', false);
|
||||||
|
}
|
||||||
|
|
||||||
$response = [
|
$response = [
|
||||||
'incomes' => $incomes,
|
'incomes' => $incomes,
|
||||||
@ -161,6 +167,7 @@ class BoxController extends Controller
|
|||||||
'size' => \count($sums),
|
'size' => \count($sums),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
$cache->store($response);
|
$cache->store($response);
|
||||||
|
|
||||||
return response()->json($response);
|
return response()->json($response);
|
||||||
|
Loading…
Reference in New Issue
Block a user