Fix budget API call

This commit is contained in:
James Cole
2021-04-23 06:03:06 +02:00
parent 98613b5ea6
commit 2b25631611
3 changed files with 10 additions and 5 deletions

View File

@@ -328,7 +328,7 @@ class BudgetRepository implements BudgetRepositoryInterface
Log::error($e->getTraceAsString());
throw new FireflyException('400002: Could not store budget.', 0, $e);
}
if (!array_key_exists('auto_budget_type', $data)) {
if (!array_key_exists('auto_budget_type', $data) || !array_key_exists('auto_budget_amount', $data) || !array_key_exists('auto_budget_period', $data)) {
return $newBudget;
}
$type = $data['auto_budget_type'];