Skip to content

Commit

Permalink
Condense routes
Browse files Browse the repository at this point in the history
  • Loading branch information
inulty-dfe committed Dec 19, 2024
1 parent 5bb0be2 commit cb28ee7
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions config/routes/publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,16 @@

# rubocop:disable Style/RedundantConstantBase
constraints(::Constraints::PartnershipFeature.new(:on)) do
get '/publish/organisations/:provider_code/:recruitment_cycle_year/accredited-providers', to: redirect('/publish/organisations/%{provider_code}/%{recruitment_cycle_year}/provider-partnerships')
get '/publish/organisations/:provider_code/:recruitment_cycle_year/accredited-providers', to: redirect('/publish/organisations/:provider_code/:recruitment_cycle_year/accredited-partnerships')
resources :accredited_partnerships, param: :accredited_provider_code, except: %i[show], path: 'accredited-partnerships', controller: 'accredited_partnerships' do
member do
get :delete
delete :delete, to: 'accredited_partnerships#destroy'
end

get '/check', on: :collection, to: 'accredited_partnerships/checks#show'
put '/check', on: :collection, to: 'accredited_partnerships/checks#update'
end
end

constraints(::Constraints::PartnershipFeature.new(:off)) do
Expand All @@ -299,19 +308,6 @@
end
end

constraints(::Constraints::PartnershipFeature.new(:on)) do
get '/publish/organisations/:provider_code/:recruitment_cycle_year/accredited-providers', to: redirect('/publish/organisations/:provider_code/:recruitment_cycle_year/provider-partnerships')
resources :accredited_partnerships, param: :accredited_provider_code, except: %i[show], path: 'provider-partnerships', controller: 'accredited_partnerships' do
member do
get :delete
delete :delete, to: 'accredited_partnerships#destroy'
end

get '/check', on: :collection, to: 'accredited_partnerships/checks#show'
put '/check', on: :collection, to: 'accredited_partnerships/checks#update'
end
end

scope ':recruitment_cycle_year/accredited-providers', as: :accredited_providers do
get '/search', on: :collection, to: 'accredited_provider_search#new'
post '/search', on: :collection, to: 'accredited_provider_search#create'
Expand Down

0 comments on commit cb28ee7

Please sign in to comment.