diff --git a/global_business/business/views/api/v1/transactions/index.json.jbuilder b/global_business/business/views/api/v1/transactions/index.json.jbuilder new file mode 100644 index 000000000..44826539e --- /dev/null +++ b/global_business/business/views/api/v1/transactions/index.json.jbuilder @@ -0,0 +1,13 @@ +json.array! @transactions do |transaction| + json.extract! transaction, :id, :amount, :transaction_type, :created_at + json.account do + json.extract! transaction.account, :id, :account_number, :routing_number + end + json.user do + json.extract! transaction.account.user, :id, :username, :email + end + json.url api_v1_transaction_url(transaction, format: :json) + json.category do + json.extract! transaction.category, :id, :name + end +end