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.

26 lines
596 B

  1. # frozen_string_literal: true
  2. class Api::V1::SuggestionsController < Api::BaseController
  3. include Authorization
  4. before_action -> { doorkeeper_authorize! :read }
  5. before_action :require_user!
  6. before_action :set_accounts
  7. respond_to :json
  8. def index
  9. render json: @accounts, each_serializer: REST::AccountSerializer
  10. end
  11. def destroy
  12. PotentialFriendshipTracker.remove(current_account.id, params[:id])
  13. render_empty
  14. end
  15. private
  16. def set_accounts
  17. @accounts = PotentialFriendshipTracker.get(current_account.id, limit: limit_param(DEFAULT_ACCOUNTS_LIMIT))
  18. end
  19. end