Skip to content

Commit

Permalink
Handle blank query term in autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
mjy committed Nov 20, 2024
1 parent ca092ec commit 990db09
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/queries/collection_object/autocomplete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def base_queries
# @return [Array]
# TODO: optimize limits
def autocomplete
return [] if term.blank?
updated_queries = base_queries

result = []
Expand Down
3 changes: 1 addition & 2 deletions lib/queries/query/autocomplete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,7 @@ def combine_or_clauses(clauses)
# default the autocomplete result to all
# TODO: eliminate
def autocomplete
# Probably: super this
# return [] if query_term.blank?
return [] if query_string.blank?
all.to_a
end

Expand Down
2 changes: 1 addition & 1 deletion lib/queries/taxon_name/autocomplete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def autocomplete_taxon_name_author_year_matches
end

# def autocomplete_cached
# base_query.where(table[:cached].eq(query_term))
# base_query.where(table[:cached].eq(query_string))
# end

# ---- gin methods
Expand Down

0 comments on commit 990db09

Please sign in to comment.