From 623c0eada56669dc7aed1f2c9afdcd2d868b8562 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sun, 1 Aug 2021 11:30:10 +0100 Subject: [PATCH] Reinstate removed naming on checkout routes and tidy up --- config/routes.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index 6e42921cfa..69d1561185 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -69,21 +69,19 @@ Openfoodnetwork::Application.routes.draw do resources :webhooks, only: [:create] end - constraints(SplitCheckoutConstraint.new) do - get '/checkout', to: 'split_checkout#edit', as: :checkout + constraints SplitCheckoutConstraint.new do + get '/checkout', to: 'split_checkout#edit' constraints step: /(details|payment|summary)/ do get '/checkout/:step', to: 'split_checkout#edit', as: :checkout_step put '/checkout/:step', to: 'split_checkout#update', as: :checkout_update end - - get '/checkout/paypal_payment/:order_id', to: 'split_checkout#paypal_payment', as: :paypal_payment end get '/checkout', to: 'checkout#edit' - put '/checkout', to: 'checkout#update' - get '/checkout/:state', to: 'checkout#edit' - get '/checkout/paypal_payment/:order_id', to: 'checkout#paypal_payment' + put '/checkout', to: 'checkout#update', as: :update_checkout + get '/checkout/:state', to: 'checkout#edit', as: :checkout_state + get '/checkout/paypal_payment/:order_id', to: 'checkout#paypal_payment', as: :paypal_payment get 'embedded_shopfront/shopfront_session', to: 'application#shopfront_session' post 'embedded_shopfront/enable', to: 'application#enable_embedded_styles'