|
|
@ -5,7 +5,8 @@ class Api::V2::SearchController < Api::BaseController
|
|
|
|
|
|
|
|
|
|
|
|
RESULTS_LIMIT = (ENV['MAX_SEARCH_RESULTS'] || 20).to_i
|
|
|
|
RESULTS_LIMIT = (ENV['MAX_SEARCH_RESULTS'] || 20).to_i
|
|
|
|
|
|
|
|
|
|
|
|
before_action -> { authorize_if_got_token! :read, :'read:search' }
|
|
|
|
before_action -> { doorkeeper_authorize! :read, :'read:search' }
|
|
|
|
|
|
|
|
before_action :require_user!
|
|
|
|
|
|
|
|
|
|
|
|
def index
|
|
|
|
def index
|
|
|
|
@search = Search.new(search_results)
|
|
|
|
@search = Search.new(search_results)
|
|
|
@ -23,7 +24,7 @@ class Api::V2::SearchController < Api::BaseController
|
|
|
|
params[:q],
|
|
|
|
params[:q],
|
|
|
|
current_account,
|
|
|
|
current_account,
|
|
|
|
limit_param(RESULTS_LIMIT),
|
|
|
|
limit_param(RESULTS_LIMIT),
|
|
|
|
search_params.merge(resolve: user_signed_in? ? truthy_param?(:resolve) : false, exclude_unreviewed: truthy_param?(:exclude_unreviewed))
|
|
|
|
search_params.merge(resolve: truthy_param?(:resolve), exclude_unreviewed: truthy_param?(:exclude_unreviewed))
|
|
|
|
)
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|