Refactor routes to use cleaner URL structure with order_id parameter
This commit is contained in:
@@ -35,32 +35,26 @@ Rails.application.routes.draw do
|
||||
get "dashboard", to: "pages#dashboard", as: "dashboard"
|
||||
|
||||
# === Events ===
|
||||
get "events", to: "events#index", as: "events"
|
||||
get "events/:slug.:id", to: "events#show", as: "event"
|
||||
get "events", to: "events#index", as: "events"
|
||||
get "events/:slug.:id", to: "events#show", as: "event"
|
||||
|
||||
# === Orders (scoped to events) ===
|
||||
get "events/:slug.:id/orders/new", to: "orders#new", as: "event_order_new"
|
||||
post "events/:slug.:id/orders", to: "orders#create", as: "event_order_create"
|
||||
# === Orders ===
|
||||
get "orders/new/events/:slug.:id", to: "orders#new", as: "order_new"
|
||||
post "orders/create/events/:slug.:id", to: "orders#create", as: "order_create"
|
||||
|
||||
resources :orders, only: [ :show ] do
|
||||
member do
|
||||
get :checkout
|
||||
post :retry_payment
|
||||
post :increment_payment_attempt
|
||||
end
|
||||
end
|
||||
get "orders/:order_id", to: "orders#show", as: "order"
|
||||
get "orders/:order_id/checkout", to: "orders#checkout", as: "order_checkout"
|
||||
post "orders/:order_id/retry_payment", to: "orders#retry_payment", as: "order_retry_payment"
|
||||
post "orders/:order_id/increment_payment_attempt", to: "orders#increment_payment_attempt", as: "order_increment_payment_attempt"
|
||||
|
||||
get "orders/payments/success", to: "orders#payment_success", as: "order_payment_success"
|
||||
get "orders/payments/cancel", to: "orders#payment_cancel", as: "order_payment_cancel"
|
||||
|
||||
# Legacy ticket routes - redirect to order system
|
||||
get "events/:slug.:id/tickets/checkout", to: "tickets#checkout", as: "ticket_checkout"
|
||||
post "events/:slug.:id/tickets/retry", to: "tickets#retry_payment", as: "ticket_retry_payment"
|
||||
get "payments/success", to: "tickets#payment_success", as: "payment_success"
|
||||
get "payments/cancel", to: "tickets#payment_cancel", as: "payment_cancel"
|
||||
# === Payments ===
|
||||
get "payments/success", to: "orders#payment_success", as: "payment_success"
|
||||
get "payments/cancel", to: "orders#payment_cancel", as: "payment_cancel"
|
||||
|
||||
# === Tickets ===
|
||||
get "tickets/:ticket_id/download", to: "events#download_ticket", as: "download_ticket"
|
||||
get "tickets/:ticket_id", to: "tickets#show", as: "ticket"
|
||||
get "tickets/:ticket_id/view", to: "tickets#ticket_view", as: "ticket_view"
|
||||
get "tickets/:ticket_id/download", to: "events#download_ticket", as: "ticket_download"
|
||||
|
||||
# === Promoter Routes ===
|
||||
namespace :promoter do
|
||||
@@ -81,7 +75,6 @@ Rails.application.routes.draw do
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# API routes versioning
|
||||
namespace :api do
|
||||
namespace :v1 do
|
||||
|
||||
Reference in New Issue
Block a user