suggestions_controller.rb 464 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. class Api::V2::SuggestionsController < Api::BaseController
  3. include Authorization
  4. before_action -> { doorkeeper_authorize! :read }
  5. before_action :require_user!
  6. before_action :set_suggestions
  7. def index
  8. render json: @suggestions, each_serializer: REST::SuggestionSerializer
  9. end
  10. private
  11. def set_suggestions
  12. @suggestions = AccountSuggestions.get(current_account, limit_param(DEFAULT_ACCOUNTS_LIMIT))
  13. end
  14. end