Kaynağa Gözat

Fix error when using search API with no query (#12541)

Fix #12462
master^2
Eugen Rochko 4 yıl önce
committed by GitHub
ebeveyn
işleme
bbf926b1c0
Veri tabanında bu imza için bilinen anahtar bulunamadı GPG Anahtar Kimliği: 4AEE18F83AFDEB23
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. +3
    -1
      app/services/search_service.rb

+ 3
- 1
app/services/search_service.rb Dosyayı Görüntüle

@@ -2,7 +2,7 @@

class SearchService < BaseService
def call(query, account, limit, options = {})
@query = query.strip
@query = query&.strip
@account = account
@options = options
@limit = limit.to_i
@@ -10,6 +10,8 @@ class SearchService < BaseService
@resolve = options[:resolve] || false

default_results.tap do |results|
next if @query.blank?

if url_query?
results.merge!(url_resource_results) unless url_resource.nil? || (@options[:type].present? && url_resource_symbol != @options[:type].to_sym)
elsif @query.present?


Yükleniyor…
İptal
Kaydet