Skip to content

Commit 0e79b58

Browse files
authored
Merge pull request #735 from citizensadvice/CP-1065-update-csr-url
feat/Update CSR URL [CP-1065]
2 parents 7e0fedf + c163313 commit 0e79b58

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

config/routes.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ def valid_format?(request)
2323
# the path below.
2424
# If the dummy page entry that represents this app is moved in Contentful, this url will need to be updated,
2525
# a redirect added in Contentful, and the CloudFront config changed to reflect the new url.
26-
CSR_APP_PATH = "/consumer/your-energy/get-a-better-energy-deal/compare-domestic-energy-suppliers-customer-service/"
26+
CSR_APP_PATH = if Feature.enabled?("FF_NEW_CSR_URL")
27+
"/consumer/energy/energy-supply/get-a-better-energy-deal/compare-domestic-energy-suppliers-customer-service/"
28+
else
29+
"/consumer/your-energy/get-a-better-energy-deal/compare-domestic-energy-suppliers-customer-service/"
30+
end
2731

2832
Rails.application.routes.draw do
2933
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
@@ -35,6 +39,13 @@ def valid_format?(request)
3539

3640
constraints CountryConstraint.new do
3741
scope "(:country)" do
42+
if Feature.enabled?("FF_NEW_CSR_URL")
43+
get "/consumer/your-energy/get-a-better-energy-deal/compare-domestic-energy-suppliers-customer-service",
44+
to: redirect(CSR_APP_PATH)
45+
get "/consumer/your-energy/get-a-better-energy-deal/compare-domestic-energy-suppliers-customer-service/:id/details",
46+
to: redirect("#{CSR_APP_PATH}%{id}/details")
47+
end
48+
3849
# full table page
3950
get CSR_APP_PATH, to: "csr_table/suppliers#index", as: "suppliers"
4051

0 commit comments

Comments
 (0)