wedding-planner/app/controllers/expenses_controller.rb

12 lines
294 B
Ruby
Raw Permalink Normal View History

2024-10-27 21:42:45 +00:00
# Copyright (C) 2024 Manuel Bustillo
2024-07-11 19:55:48 +02:00
class ExpensesController < ApplicationController
2024-10-28 23:01:46 +01:00
def summary
render json: Expenses::TotalQuery.new.call
end
def index
render json: Expense.all.order(pricing_type: :asc, amount: :desc).as_json(only: %i[id name amount pricing_type])
end
2024-07-11 19:55:48 +02:00
end