Add temporary placeholder for API endpoint

This commit is contained in:
Matt-Yorkley
2019-10-02 01:44:00 +01:00
parent 96428c11c6
commit bc826f73a1
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
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

View File

@@ -44,6 +44,8 @@ Openfoodnetwork::Application.routes.draw do
resources :order_cycles do
get :managed, on: :collection
get :accessible, on: :collection
get :products, on: :member
end
resource :status do