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.

24 lines
576 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. def index
  8. render json: @accounts, each_serializer: REST::AccountSerializer
  9. end
  10. def destroy
  11. PotentialFriendshipTracker.remove(current_account.id, params[:id])
  12. render_empty
  13. end
  14. private
  15. def set_accounts
  16. @accounts = PotentialFriendshipTracker.get(current_account.id, limit: limit_param(DEFAULT_ACCOUNTS_LIMIT))
  17. end
  18. end