Add page for authorizing/rejecting follow requests
This commit is contained in:
parent
3c841c7306
commit
b302b9202b
14 changed files with 99 additions and 10 deletions
28
app/controllers/follow_requests_controller.rb
Normal file
28
app/controllers/follow_requests_controller.rb
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue