24 lines
429 B
Ruby
24 lines
429 B
Ruby
class Api::V1::FinancialTransactionsController < Api::V1::BaseController
|
|
include Concerns::CollectionScope
|
|
|
|
before_action ->{ doorkeeper_authorize! 'finance:read', 'finance:write' }
|
|
|
|
def index
|
|
render_collection search_scope
|
|
end
|
|
|
|
def show
|
|
render json: scope.find(params.require(:id))
|
|
end
|
|
|
|
private
|
|
|
|
def scope
|
|
FinancialTransaction.includes(:user)
|
|
end
|
|
|
|
def ransack_auth_object
|
|
:finance
|
|
end
|
|
|
|
end
|