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.

28 lines
563 B

  1. # frozen_string_literal: true
  2. class FollowRequestsController < ApplicationController
  3. layout 'auth'
  4. before_action :authenticate_user!
  5. before_action :set_follow_request, except: :index
  6. def index
  7. @follow_requests = FollowRequest.where(target_account: current_account)
  8. end
  9. def authorize
  10. @follow_request.authorize!
  11. redirect_to follow_requests_path
  12. end
  13. def reject
  14. @follow_request.reject!
  15. redirect_to follow_requests_path
  16. end
  17. private
  18. def set_follow_request
  19. @follow_request = FollowRequest.find(params[:id])
  20. end
  21. end