0
0
Fork 0

New API method: /api/v1/search

Returns accounts, statuses, hashtags arrays
This commit is contained in:
Eugen Rochko 2017-03-22 02:32:27 +01:00
parent 98571b0ce4
commit 05cf086766
9 changed files with 99 additions and 17 deletions

View file

@ -115,7 +115,7 @@ class Api::V1::AccountsController < ApiController
end
def search
@accounts = SearchService.new.call(params[:q], limit_param(DEFAULT_ACCOUNTS_LIMIT), params[:resolve] == 'true', current_account)
@accounts = AccountSearchService.new.call(params[:q], limit_param(DEFAULT_ACCOUNTS_LIMIT), params[:resolve] == 'true', current_account)
set_account_counters_maps(@accounts) unless @accounts.nil?

View file

@ -0,0 +1,9 @@
# frozen_string_literal: true
class Api::V1::SearchController < ApiController
respond_to :json
def index
@search = OpenStruct.new(SearchService.new.call(params[:q], 5, params[:resolve] == 'true', current_account))
end
end