Basic amount fix

This commit is contained in:
James Cole 2022-08-23 05:46:59 +02:00
parent 0b49e9b8a8
commit 70c08d6b50
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -206,6 +206,14 @@ class BudgetLimitController extends Controller
$amount = '0';
}
// sanity check on amount:
if ((float) $amount === 0.0) {
$amount = '1';
}
if ((int) $amount > 65536) {
$amount = '65536';
}
$limit = $this->blRepository->update($budgetLimit, ['amount' => $amount]);
$array = $limit->toArray();