API v1 financial_transactions endpoints (#627)
This commit is contained in:
parent
8c8b42c2b2
commit
b96ce06d94
10 changed files with 397 additions and 1 deletions
|
|
@ -0,0 +1,21 @@
|
|||
class Api::V1::User::FinancialTransactionsController < Api::V1::BaseController
|
||||
include Concerns::CollectionScope
|
||||
|
||||
before_action ->{ doorkeeper_authorize! 'finance:user' }
|
||||
before_action :require_ordergroup
|
||||
|
||||
def index
|
||||
render_collection search_scope
|
||||
end
|
||||
|
||||
def show
|
||||
render json: scope.find(params.require(:id))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def scope
|
||||
current_ordergroup.financial_transactions.includes(:user)
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue