Add transactions API
This commit is contained in:
parent
4eb84e1c91
commit
dee3e9a50a
3 changed files with 8 additions and 3 deletions
|
@ -6,6 +6,10 @@ class RequestsController < ApplicationController
|
|||
|
||||
def index
|
||||
@requests = @user.incoming_requests.group_by(&:status)
|
||||
respond_to do |format|
|
||||
format.html { }
|
||||
format.json { render json: @requests }
|
||||
end
|
||||
end
|
||||
|
||||
def confirm
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
%input.live-updating.value-thing{type: 'text', placeholder: 'Filter on Message',
|
||||
class: "form-control" }
|
||||
|
||||
%table#transactions.pure-table.pure-table-striped{data: { source: user_transactions_path(@user) }}
|
||||
%table#transactions.pure-table.pure-table-striped{data: { source: user_transactions_datatable_path(@user) }}
|
||||
%thead
|
||||
%tr
|
||||
%th Time
|
||||
|
|
|
@ -13,7 +13,7 @@ Rails.application.routes.draw do
|
|||
|
||||
root to: 'pages#sign_in_page'
|
||||
|
||||
resources :transactions, only: [:index, :create]
|
||||
resources :transactions, only: [:create]
|
||||
resources :users, only: [:index, :show] do
|
||||
resources :requests, only: [:index], shallow: true do
|
||||
post :confirm
|
||||
|
@ -22,8 +22,9 @@ Rails.application.routes.draw do
|
|||
resources :notifications, only: [:index], shallow: true do
|
||||
post :read
|
||||
end
|
||||
resources :transactions, only: [:index], shallow: true
|
||||
post :reset_key, on: :member
|
||||
end
|
||||
|
||||
get 'datatables/:id' => 'datatables#transactions_for_user', as: "user_transactions"
|
||||
get 'datatables/:id' => 'datatables#transactions_for_user', as: "user_transactions_datatable"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue