init push - laying out the project
This commit is contained in:
@ -0,0 +1,14 @@
|
||||
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
|
Reference in New Issue
Block a user