mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 14:29:53 +01:00
Move block action into Settings::BlocksController
This commit is contained in:
parent
6b5e59fa1c
commit
72d37032e6
3 changed files with 13 additions and 6 deletions
10
app/controllers/settings/blocks_controller.rb
Normal file
10
app/controllers/settings/blocks_controller.rb
Normal file
|
@ -0,0 +1,10 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Settings::BlocksController < ApplicationController
|
||||
before_action :authenticate_user!
|
||||
|
||||
def index
|
||||
@blocks = Relationships::Block.where(source: current_user)
|
||||
@anonymous_blocks = AnonymousBlock.where(user: current_user)
|
||||
end
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
class UserController < ApplicationController
|
||||
before_action :authenticate_user!, only: %w[data edit_blocks]
|
||||
before_action :authenticate_user!, only: %w[data]
|
||||
|
||||
def show
|
||||
@user = User.where('LOWER(screen_name) = ?', params[:username].downcase).includes(:profile).first!
|
||||
|
@ -68,9 +68,4 @@ class UserController < ApplicationController
|
|||
|
||||
def data
|
||||
end
|
||||
|
||||
def edit_blocks
|
||||
@blocks = Relationships::Block.where(source: current_user)
|
||||
@anonymous_blocks = AnonymousBlock.where(user: current_user)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -77,6 +77,8 @@ Rails.application.routes.draw do
|
|||
|
||||
get :muted, to: 'mutes#index'
|
||||
|
||||
get :blocks, to: 'blocks#index'
|
||||
|
||||
namespace :two_factor_authentication do
|
||||
get :otp_authentication, to: 'otp_authentication#index'
|
||||
patch :otp_authentication, to: 'otp_authentication#update'
|
||||
|
|
Loading…
Reference in a new issue