Files
openfoodnetwork/app/controllers/api/order_cycles_controller.rb
2019-10-03 18:11:40 +01:00

15 lines
469 B
Ruby

module Api
class OrderCyclesController < BaseController
respond_to :json
def products
products = OpenFoodNetwork::ProductsRenderer.new(current_distributor, current_order_cycle, params).products_json
# products = ::ProductsFilterer.new(current_distributor, current_customer, products_json).call # TBD
render json: products
rescue OpenFoodNetwork::ProductsRenderer::NoProducts
render status: :not_found, json: ''
end
end
end