Class: Api::V1::User::FinancialTransactionsController

Inherits:
BaseController
  • Object
show all
Includes:
Concerns::CollectionScope
Defined in:
app/controllers/api/v1/user/financial_transactions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



17
18
19
20
21
22
# File 'app/controllers/api/v1/user/financial_transactions_controller.rb', line 17

def create
  transaction_type = FinancialTransactionType.find(create_params[:financial_transaction_type_id])
  ft = current_ordergroup.add_financial_transaction!(create_params[:amount], create_params[:note], current_user,
                                                     transaction_type)
  render json: ft
end

#indexObject



9
10
11
# File 'app/controllers/api/v1/user/financial_transactions_controller.rb', line 9

def index
  render_collection search_scope
end

#showObject



13
14
15
# File 'app/controllers/api/v1/user/financial_transactions_controller.rb', line 13

def show
  render json: scope.find(params.require(:id))
end