mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Update autocomplete code for #3150
This commit is contained in:
@@ -414,7 +414,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
|
||||
$search->where('piggy_banks.name', 'LIKE', sprintf('%%%s%%', $query));
|
||||
}
|
||||
$search->orderBy('piggy_banks.order', 'ASC')
|
||||
->orderBy('piggy_banks.name', 'ASC')->where('piggy_banks.active', 1);
|
||||
->orderBy('piggy_banks.name', 'ASC');
|
||||
|
||||
return $search->take($limit)->get();
|
||||
}
|
||||
|
@@ -287,10 +287,11 @@ class TagRepository implements TagRepositoryInterface
|
||||
* Search the users tags.
|
||||
*
|
||||
* @param string $query
|
||||
* @param int $limit
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function searchTags(string $query): Collection
|
||||
public function searchTags(string $query, int $limit): Collection
|
||||
{
|
||||
/** @var Collection $tags */
|
||||
$tags = $this->user->tags()->orderBy('tag', 'ASC');
|
||||
@@ -299,7 +300,7 @@ class TagRepository implements TagRepositoryInterface
|
||||
$tags->where('tag', 'LIKE', $search);
|
||||
}
|
||||
|
||||
return $tags->get();
|
||||
return $tags->take($limit)->get('tags.*');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -165,10 +165,11 @@ interface TagRepositoryInterface
|
||||
* Search the users tags.
|
||||
*
|
||||
* @param string $query
|
||||
* @param int $limit
|
||||
*
|
||||
* @return Collection
|
||||
*/
|
||||
public function searchTags(string $query): Collection;
|
||||
public function searchTags(string $query, int $limit): Collection;
|
||||
|
||||
/**
|
||||
* @param User $user
|
||||
|
Reference in New Issue
Block a user