From 1bb4fdf2946aa96b1ffd75acc56af54cb5c34cf8 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 3 Mar 2026 11:20:12 +1100 Subject: [PATCH] Remove compatibility redirect for APIv0 --- config/routes/api.rb | 3 --- spec/requests/api/routes_spec.rb | 11 ----------- 2 files changed, 14 deletions(-) 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}" }