Added search filter for isVerified accounts
• Added: - search filter for isVerified accounts • Todo: - Implement in account search query
This commit is contained in:
@@ -7,6 +7,7 @@ class AccountSearchService < BaseService
|
||||
@query = query.strip
|
||||
@limit = options[:limit].to_i
|
||||
@offset = options[:offset].to_i
|
||||
@onlyVerified = options[:onlyVerified] || false
|
||||
@options = options
|
||||
@account = account
|
||||
|
||||
@@ -84,11 +85,11 @@ class AccountSearchService < BaseService
|
||||
end
|
||||
|
||||
def advanced_search_results
|
||||
Account.advanced_search_for(terms_for_query, account, limit, options[:following], offset)
|
||||
Account.advanced_search_for(terms_for_query, account, limit, options[:following], offset, onlyVerified: @onlyVerified)
|
||||
end
|
||||
|
||||
def simple_search_results
|
||||
Account.search_for(terms_for_query, limit, offset)
|
||||
Account.search_for(terms_for_query, limit, offset, onlyVerified: @onlyVerified)
|
||||
end
|
||||
|
||||
def terms_for_query
|
||||
|
||||
@@ -8,6 +8,7 @@ class SearchService < BaseService
|
||||
@limit = limit.to_i
|
||||
@offset = options[:type].blank? ? 0 : options[:offset].to_i
|
||||
@resolve = options[:resolve] || false
|
||||
@onlyVerified = options[:onlyVerified] || false
|
||||
|
||||
default_results.tap do |results|
|
||||
next if @query.blank? || @limit.zero?
|
||||
@@ -31,7 +32,8 @@ class SearchService < BaseService
|
||||
@account,
|
||||
limit: @limit,
|
||||
resolve: @resolve,
|
||||
offset: @offset
|
||||
offset: @offset,
|
||||
onlyVerified: @onlyVerified
|
||||
)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user