foodsoft/app/controllers/api/v1/user/financial_transactions_cont...

22 lines
458 B
Ruby
Raw Normal View History

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, :financial_transaction_type)
end
end