mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-27 06:05:19 +00:00
Add temporary placeholder for API endpoint
This commit is contained in:
14
app/controllers/api/order_cycles_controller.rb
Normal file
14
app/controllers/api/order_cycles_controller.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user