The code powering m.abunchtell.com https://m.abunchtell.com
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

27 行
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