fix MR comments
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
class AccountLocksController < ApplicationController
|
||||
class Admin::AccountLocksController < Admin::ApplicationController
|
||||
before_action :set_account
|
||||
|
||||
def create
|
||||
@@ -16,8 +16,8 @@ class AccountLocksController < ApplicationController
|
||||
private
|
||||
|
||||
def set_account
|
||||
if params[:id].present?
|
||||
@account = Account.find(params[:id])
|
||||
if params[:account_id].present?
|
||||
@account = Account.find_by(slug: params[:account_id])
|
||||
else
|
||||
failure_redirect
|
||||
end
|
||||
@@ -31,9 +31,9 @@
|
||||
<%= link_to fa_icon("pencil", text: "Edit"), edit_admin_account_path(account), class: "dropdown-item" %>
|
||||
<%= link_to fa_icon("arrow-right", text: "Account Managers"), account_auths_path({ account_id: account.id}), class: "dropdown-item" %>
|
||||
<% if account.locked? %>
|
||||
<%= link_to fa_icon("unlock", text: "Unlock Account"), [:account, :lock, id: account.id], method: :delete, class: "dropdown-item" %>
|
||||
<%= link_to fa_icon("unlock", text: "Unlock Account"), [:admin, account, :lock], method: :delete, class: "dropdown-item" %>
|
||||
<% else %>
|
||||
<%= link_to fa_icon("lock", text: "Lock Account"), [:account, :lock, id: account.id], method: :post, class: "dropdown-item" %>
|
||||
<%= link_to fa_icon("lock", text: "Lock Account"), [:admin, account, :lock], method: :post, class: "dropdown-item" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,7 +30,9 @@ Rails.application.routes.draw do
|
||||
namespace :admin do
|
||||
mount Sidekiq::Web => '/background_queue', as: :background_queue
|
||||
|
||||
resources :accounts, only: [:index, :new, :create, :edit, :update, :show]
|
||||
resources :accounts, only: [:index, :new, :create, :edit, :update, :show] do
|
||||
resource :account_lock, path: :lock, as: :lock, only: [:create, :destroy]
|
||||
end
|
||||
resources :users, only: [:index, :new, :create, :edit, :update, :destroy] do
|
||||
resource :masquerade, only: :create
|
||||
end
|
||||
@@ -49,7 +51,6 @@ Rails.application.routes.draw do
|
||||
resource :account_session, only: [:update]
|
||||
resource :session, only: [:destroy]
|
||||
resource :account, only: [:new, :create, :update] do
|
||||
resource :account_locks, path: :lock, as: :lock, only: [:create, :destroy]
|
||||
get 'locked' => 'locked_accounts#index'
|
||||
end
|
||||
resources :account_auths, only: [:index, :create, :update, :destroy]
|
||||
|
||||
Reference in New Issue
Block a user