The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

27 lines
622 B

  1. # frozen_string_literal: true
  2. class Api::V1::Accounts::SearchController < Api::BaseController
  3. before_action -> { doorkeeper_authorize! :read, :'read:accounts' }
  4. before_action :require_user!
  5. respond_to :json
  6. def show
  7. @accounts = account_search
  8. render json: @accounts, each_serializer: REST::AccountSerializer
  9. end
  10. private
  11. def account_search
  12. AccountSearchService.new.call(
  13. params[:q],
  14. current_account,
  15. limit: limit_param(DEFAULT_ACCOUNTS_LIMIT),
  16. resolve: truthy_param?(:resolve),
  17. following: truthy_param?(:following),
  18. offset: params[:offset]
  19. )
  20. end
  21. end