mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-20 04:59:16 +00:00
Remove compatibility redirect for APIv0
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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}" }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user