Fix /api/v2/search not working with following query param (#25681)

This commit is contained in:
Daniel M Brasil
2023-07-03 13:06:57 -03:00
committed by GitHub
parent 69e124e2ed
commit 383c00819c
4 changed files with 42 additions and 13 deletions

View File

@ -2,12 +2,13 @@
class SearchService < BaseService
def call(query, account, limit, options = {})
@query = query&.strip
@account = account
@options = options
@limit = limit.to_i
@offset = options[:type].blank? ? 0 : options[:offset].to_i
@resolve = options[:resolve] || false
@query = query&.strip
@account = account
@options = options
@limit = limit.to_i
@offset = options[:type].blank? ? 0 : options[:offset].to_i
@resolve = options[:resolve] || false
@following = options[:following] || false
default_results.tap do |results|
next if @query.blank? || @limit.zero?
@ -31,7 +32,8 @@ class SearchService < BaseService
limit: @limit,
resolve: @resolve,
offset: @offset,
use_searchable_text: true
use_searchable_text: true,
following: @following
)
end