mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-04 19:53:44 +00:00
Fix #3871
This commit is contained in:
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace FireflyIII\Api\V1\Requests\Autocomplete;
|
||||
|
||||
|
||||
use FireflyIII\Models\AccountType;
|
||||
use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
@@ -58,6 +59,12 @@ class AutocompleteRequest extends FormRequest
|
||||
$limit = $this->integer('limit');
|
||||
$limit = 0 === $limit ? 10 : $limit;
|
||||
|
||||
// remove 'initial balance' from allowed types. its internal
|
||||
if (($key = array_search(AccountType::INITIAL_BALANCE, $array)) !== false) {
|
||||
unset($types[$key]);
|
||||
$array = array_values($array);
|
||||
}
|
||||
|
||||
return [
|
||||
'types' => $array,
|
||||
'query' => $this->string('query'),
|
||||
|
Reference in New Issue
Block a user