mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-05 04:03:26 +00:00
Add nullable types in validation.
This commit is contained in:
@@ -324,7 +324,7 @@ class UpdateRequest extends FormRequest
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
// basic fields for group:
|
// basic fields for group:
|
||||||
'group_title' => 'between:1,1000',
|
'group_title' => 'between:1,1000|nullable',
|
||||||
'apply_rules' => [new IsBoolean()],
|
'apply_rules' => [new IsBoolean()],
|
||||||
|
|
||||||
// transaction rules (in array for splits):
|
// transaction rules (in array for splits):
|
||||||
@@ -360,7 +360,7 @@ class UpdateRequest extends FormRequest
|
|||||||
// budget, category, bill and piggy
|
// budget, category, bill and piggy
|
||||||
'transactions.*.budget_id' => ['mustExist:budgets,id', new BelongsUser()],
|
'transactions.*.budget_id' => ['mustExist:budgets,id', new BelongsUser()],
|
||||||
'transactions.*.budget_name' => ['between:1,255', 'nullable', new BelongsUser()],
|
'transactions.*.budget_name' => ['between:1,255', 'nullable', new BelongsUser()],
|
||||||
'transactions.*.category_id' => ['mustExist:categories,id', new BelongsUser()],
|
'transactions.*.category_id' => ['mustExist:categories,id', new BelongsUser(), 'nullable'],
|
||||||
'transactions.*.category_name' => 'between:1,255|nullable',
|
'transactions.*.category_name' => 'between:1,255|nullable',
|
||||||
'transactions.*.bill_id' => ['numeric', 'nullable', 'mustExist:bills,id', new BelongsUser()],
|
'transactions.*.bill_id' => ['numeric', 'nullable', 'mustExist:bills,id', new BelongsUser()],
|
||||||
'transactions.*.bill_name' => ['between:1,255', 'nullable', new BelongsUser()],
|
'transactions.*.bill_name' => ['between:1,255', 'nullable', new BelongsUser()],
|
||||||
|
Reference in New Issue
Block a user