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
|
def index
|
||||||
@requests = @user.incoming_requests.group_by(&:status)
|
@requests = @user.incoming_requests.group_by(&:status)
|
||||||
|
respond_to do |format|
|
||||||
|
format.html { }
|
||||||
|
format.json { render json: @requests }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def confirm
|
def confirm
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
%input.live-updating.value-thing{type: 'text', placeholder: 'Filter on Message',
|
%input.live-updating.value-thing{type: 'text', placeholder: 'Filter on Message',
|
||||||
class: "form-control" }
|
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
|
%thead
|
||||||
%tr
|
%tr
|
||||||
%th Time
|
%th Time
|
||||||
|
|
|
@ -13,7 +13,7 @@ Rails.application.routes.draw do
|
||||||
|
|
||||||
root to: 'pages#sign_in_page'
|
root to: 'pages#sign_in_page'
|
||||||
|
|
||||||
resources :transactions, only: [:index, :create]
|
resources :transactions, only: [:create]
|
||||||
resources :users, only: [:index, :show] do
|
resources :users, only: [:index, :show] do
|
||||||
resources :requests, only: [:index], shallow: true do
|
resources :requests, only: [:index], shallow: true do
|
||||||
post :confirm
|
post :confirm
|
||||||
|
@ -22,8 +22,9 @@ Rails.application.routes.draw do
|
||||||
resources :notifications, only: [:index], shallow: true do
|
resources :notifications, only: [:index], shallow: true do
|
||||||
post :read
|
post :read
|
||||||
end
|
end
|
||||||
|
resources :transactions, only: [:index], shallow: true
|
||||||
post :reset_key, on: :member
|
post :reset_key, on: :member
|
||||||
end
|
end
|
||||||
|
|
||||||
get 'datatables/:id' => 'datatables#transactions_for_user', as: "user_transactions"
|
get 'datatables/:id' => 'datatables#transactions_for_user', as: "user_transactions_datatable"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue