admin/app/controllers/workarea/api/admin/payments_controller.rb in workarea-api-4.4.7 vs admin/app/controllers/workarea/api/admin/payments_controller.rb in workarea-api-4.5.0
- old
+ new
@@ -32,10 +32,15 @@
key :type, :string
key :enum, %w(asc desc)
key :default, 'desc'
end
+ parameter :updated_at_starts_at
+ parameter :updated_at_ends_at
+ parameter :created_at_starts_at
+ parameter :created_at_ends_at
+
response 200 do
key :description, 'Payments'
schema do
key :type, :object
property :payments do
@@ -50,9 +55,11 @@
end
def index
@payments = Payment
.all
+ .by_updated_at(starts_at: params[:updated_at_starts_at], ends_at: params[:updated_at_ends_at])
+ .by_created_at(starts_at: params[:created_at_starts_at], ends_at: params[:created_at_ends_at])
.order_by(sort_field => sort_direction)
.page(params[:page])
respond_with payments: @payments
end