diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-23 00:04:52 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2016-12-23 00:04:52 +0100 |
commit | b302b9202b17abe9834460acf589b512579766d6 (patch) | |
tree | 927362d8752727f32e93c733a7cba573608ede70 /app/controllers | |
parent | 3c841c73062a43a634ff7407ef3e6c84c5510c96 (diff) |
Add page for authorizing/rejecting follow requests
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/follow_requests_controller.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/app/controllers/follow_requests_controller.rb b/app/controllers/follow_requests_controller.rb new file mode 100644 index 000000000..d4368f773 --- /dev/null +++ b/app/controllers/follow_requests_controller.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class FollowRequestsController < ApplicationController + layout 'auth' + + before_action :authenticate_user! + before_action :set_follow_request, except: :index + + def index + @follow_requests = FollowRequest.where(target_account: current_account) + end + + def authorize + @follow_request.authorize! + redirect_to follow_requests_path + end + + def reject + @follow_request.reject! + redirect_to follow_requests_path + end + + private + + def set_follow_request + @follow_request = FollowRequest.find(params[:id]) + end +end |