mirror of
				https://github.com/firefly-iii/firefly-iii.git
				synced 2025-11-04 05:15:39 +00:00 
			
		
		
		
	Update category code for #4015
This commit is contained in:
		@@ -47,9 +47,7 @@ use League\Fractal\Resource\Item;
 | 
			
		||||
class CategoryController extends Controller
 | 
			
		||||
{
 | 
			
		||||
    use TransactionFilter;
 | 
			
		||||
 | 
			
		||||
    /** @var CategoryRepositoryInterface The category repository */
 | 
			
		||||
    private $repository;
 | 
			
		||||
    private CategoryRepositoryInterface $repository;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -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