From b6c593d5a466ac07f36a3c0c5fa841dbff282b13 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 6 Sep 2021 16:51:19 +0100 Subject: [PATCH] Feature toggle API reports --- config/routes/api.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/routes/api.rb b/config/routes/api.rb index cb950c52ec..120563ce75 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -78,7 +78,8 @@ Openfoodnetwork::Application.routes.draw do end end - get '/reports/:report_type(/:report_subtype)', to: 'reports#show' + get '/reports/:report_type(/:report_subtype)', to: 'reports#show', + constraints: lambda { |_| Flipper.enabled?(:api_reports) } end match '*path', to: redirect(path: "/api/v0/%{path}"), via: :all, constraints: { path: /(?!v[0-9]).+/ }