mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix #3871
This commit is contained in:
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||||||
namespace FireflyIII\Api\V1\Requests\Autocomplete;
|
namespace FireflyIII\Api\V1\Requests\Autocomplete;
|
||||||
|
|
||||||
|
|
||||||
|
use FireflyIII\Models\AccountType;
|
||||||
use FireflyIII\Support\Request\ConvertsDataTypes;
|
use FireflyIII\Support\Request\ConvertsDataTypes;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
@@ -58,6 +59,12 @@ class AutocompleteRequest extends FormRequest
|
|||||||
$limit = $this->integer('limit');
|
$limit = $this->integer('limit');
|
||||||
$limit = 0 === $limit ? 10 : $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 [
|
return [
|
||||||
'types' => $array,
|
'types' => $array,
|
||||||
'query' => $this->string('query'),
|
'query' => $this->string('query'),
|
||||||
|
Reference in New Issue
Block a user