mirror of
https://github.com/internetee/registry.git
synced 2025-06-05 12:17:30 +02:00
fixed error
This commit is contained in:
parent
b8cf5a9009
commit
f08e95642d
1 changed files with 8 additions and 8 deletions
|
@ -15,16 +15,16 @@ module Admin
|
|||
def edit; end
|
||||
|
||||
def update
|
||||
if @account.valid?
|
||||
action = Actions::AccountActivityCreate.new(@account,
|
||||
params[:account][:balance],
|
||||
params[:description],
|
||||
AccountActivity::UPDATE_CREDIT)
|
||||
redirect_to admin_accounts_path, notice: t('.updated') && return if action.call
|
||||
action = Actions::AccountActivityCreate.new(@account,
|
||||
params[:account][:balance],
|
||||
params[:description],
|
||||
AccountActivity::UPDATE_CREDIT)
|
||||
unless action.call
|
||||
flash[:alert] = t('invalid_balance')
|
||||
render 'edit'
|
||||
end
|
||||
|
||||
flash[:alert] = t('invalid_balance')
|
||||
render 'edit'
|
||||
redirect_to admin_accounts_path, notice: t('.updated') if action.call
|
||||
end
|
||||
|
||||
private
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue