15 lines
550 B
Ruby
15 lines
550 B
Ruby
class Api::V1::ExchangeAccountsController < Api::AuthenticatedApiController
|
|
def update
|
|
exchange_account = ExchangeAccount.find(params[:exchange_account_id])
|
|
render json: { success: false} and return unless exchange_account
|
|
|
|
payload = {}
|
|
payload[:betting_enabled] = params['canBet'] unless params['canBet'].nil?
|
|
payload[:status] = params['isActive'] == true ? 'active' : 'inactive' unless params['isActive'].nil?
|
|
|
|
exchange_account.update(payload) unless payload.empty?
|
|
render json: { success: true} and return
|
|
end
|
|
|
|
end
|