parent
f0e3b99553
commit
5d810aae4f
1 changed files with 3 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
class SearchService < BaseService
|
class SearchService < BaseService
|
||||||
def call(query, account, limit, options = {})
|
def call(query, account, limit, options = {})
|
||||||
@query = query.strip
|
@query = query&.strip
|
||||||
@account = account
|
@account = account
|
||||||
@options = options
|
@options = options
|
||||||
@limit = limit.to_i
|
@limit = limit.to_i
|
||||||
|
@ -10,6 +10,8 @@ class SearchService < BaseService
|
||||||
@resolve = options[:resolve] || false
|
@resolve = options[:resolve] || false
|
||||||
|
|
||||||
default_results.tap do |results|
|
default_results.tap do |results|
|
||||||
|
next if @query.blank?
|
||||||
|
|
||||||
if url_query?
|
if url_query?
|
||||||
results.merge!(url_resource_results) unless url_resource.nil? || (@options[:type].present? && url_resource_symbol != @options[:type].to_sym)
|
results.merge!(url_resource_results) unless url_resource.nil? || (@options[:type].present? && url_resource_symbol != @options[:type].to_sym)
|
||||||
elsif @query.present?
|
elsif @query.present?
|
||||||
|
|
Loading…
Reference in a new issue