mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 05:26:17 +00:00
Update category code for #4015
This commit is contained in:
@@ -45,7 +45,8 @@ class CategoryStoreRequest extends FormRequest
|
||||
public function getAll(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->string('name'),
|
||||
'name' => $this->string('name'),
|
||||
'notes' => $this->nlString('notes'),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -57,7 +58,7 @@ class CategoryStoreRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => 'required|between:1,100|uniqueObjectForUser:categories,name'
|
||||
'name' => 'required|between:1,100|uniqueObjectForUser:categories,name',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,8 +43,15 @@ class CategoryUpdateRequest extends FormRequest
|
||||
*/
|
||||
public function getAll(): array
|
||||
{
|
||||
$notes = null;
|
||||
$all = $this->all();
|
||||
if (array_key_exists('notes', $all)) {
|
||||
$notes = $this->nlString('notes');
|
||||
}
|
||||
|
||||
return [
|
||||
'name' => $this->string('name'),
|
||||
'name' => $this->string('name'),
|
||||
'notes' => $notes,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user