add mutations to exchange painel
This commit is contained in:
@@ -10,10 +10,12 @@ module Mutations
|
||||
amount = BigDecimal(order[:amount])
|
||||
|
||||
ActiveRecord::Base.transaction do
|
||||
current_user.balances.find_by!(currency_id: currency_id)
|
||||
current_user
|
||||
.balances
|
||||
.find_by!(currency_id: currency_id)
|
||||
.withdrawal!(amount)
|
||||
|
||||
record = SellCryptoOrder.create(
|
||||
record = SellCryptoOrder.create!(
|
||||
paid_amount: amount,
|
||||
currency_id: currency_id,
|
||||
user_id: current_user.id,
|
||||
|
||||
Reference in New Issue
Block a user