This commit is contained in:
James Cole
2019-09-01 14:49:26 +02:00
parent 48d3130b36
commit f5b01c7b21
3 changed files with 8 additions and 6 deletions

View File

@@ -63,8 +63,8 @@ class BelongsUser implements Rule
/** /**
* Determine if the validation rule passes. * Determine if the validation rule passes.
* *
* @param string $attribute * @param string $attribute
* @param mixed $value * @param mixed $value
* *
* @return bool * @return bool
* @throws FireflyException * @throws FireflyException
@@ -197,6 +197,9 @@ class BelongsUser implements Rule
*/ */
private function validateBudgetId(int $value): bool private function validateBudgetId(int $value): bool
{ {
if (0 === $value) {
return true;
}
$count = Budget::where('id', '=', $value)->where('user_id', '=', auth()->user()->id)->count(); $count = Budget::where('id', '=', $value)->where('user_id', '=', auth()->user()->id)->count();
return 1 === $count; return 1 === $count;

2
public/v1/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -570,9 +570,8 @@
currentArray.foreign_currency_id = foreignCurrency; currentArray.foreign_currency_id = foreignCurrency;
} }
// set budget id and piggy ID. // set budget id and piggy ID.
if (parseInt(row.budget) > 0) { currentArray.budget_id = parseInt(row.budget);
currentArray.budget_id = parseInt(row.budget);
}
if (parseInt(row.piggy_bank) > 0) { if (parseInt(row.piggy_bank) > 0) {
currentArray.piggy_bank_id = parseInt(row.piggy_bank); currentArray.piggy_bank_id = parseInt(row.piggy_bank);
} }