diff --git a/config/routes/api.rb b/config/routes/api.rb index 4df930deaf..232c43d024 100644 --- a/config/routes/api.rb +++ b/config/routes/api.rb @@ -95,8 +95,5 @@ Openfoodnetwork::Application.routes.draw do resources :customer_account_transaction, only: [:create] end - - match '*path', to: redirect(path: "/api/v0/%{path}"), via: :all, - constraints: { path: /(?!v[0-9]).+/ } end end diff --git a/spec/requests/api/routes_spec.rb b/spec/requests/api/routes_spec.rb index 787fea4b78..36b3bd2903 100644 --- a/spec/requests/api/routes_spec.rb +++ b/spec/requests/api/routes_spec.rb @@ -6,17 +6,6 @@ RSpec.describe 'Orders Cycles endpoint' do let(:distributor) { create(:distributor_enterprise) } let(:order_cycle) { create(:order_cycle, distributors: [distributor]) } - context "requesting the latest version" do - let(:path) { "/api/order_cycles/#{order_cycle.id}/products?distributor=#{distributor.id}" } - - it "redirects to v0, preserving URL params" do - get path - expect(response).to redirect_to( - "/api/v0/order_cycles/#{order_cycle.id}/products?distributor=#{distributor.id}" - ) - end - end - context "requesting a specific API version" do let(:path) { "/api/v0/order_cycles/#{order_cycle.id}/products?distributor=#{distributor.id}" }