Create customers controller

And add new customers routes.

Disable them in production for now.
This commit is contained in:
Matt-Yorkley
2021-06-20 09:08:05 +01:00
committed by Maikel Linke
parent c4e2c8cb4c
commit 3128232d7e
2 changed files with 25 additions and 0 deletions

View 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

View File

@@ -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