New API method: /api/v1/search
Returns accounts, statuses, hashtags arrays
This commit is contained in:
parent
98571b0ce4
commit
05cf086766
9 changed files with 99 additions and 17 deletions
|
@ -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?
|
||||
|
||||
|
|
9
app/controllers/api/v1/search_controller.rb
Normal file
9
app/controllers/api/v1/search_controller.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue