mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Create customers controller
And add new customers routes. Disable them in production for now.
This commit is contained in:
committed by
Maikel Linke
parent
c4e2c8cb4c
commit
3128232d7e
15
app/controllers/api/v1/customers_controller.rb
Normal file
15
app/controllers/api/v1/customers_controller.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module V1
|
||||
class CustomersController < Api::V1::BaseController
|
||||
def index; end
|
||||
|
||||
def show; end
|
||||
|
||||
def update; end
|
||||
|
||||
def destroy; end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -87,6 +87,16 @@ Openfoodnetwork::Application.routes.draw do
|
||||
constraints: lambda { |_| Flipper.enabled?(:api_reports) }
|
||||
end
|
||||
|
||||
unless Rails.env.production?
|
||||
namespace :v1 do
|
||||
resources :customers
|
||||
|
||||
resources :enterprises do
|
||||
resources :customers, only: :index
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
match '*path', to: redirect(path: "/api/v0/%{path}"), via: :all, constraints: { path: /(?!v[0-9]).+/ }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user