refactor: extract cart storage to dedicated API controller with dynamic frontend URLs
All checks were successful
Ruby on Rails Test / rails-test (push) Successful in 1m7s
All checks were successful
Ruby on Rails Test / rails-test (push) Successful in 1m7s
- Added dedicated CartsController for session-based cart storage - Refactored routes to use POST /api/v1/carts/store - Updated ticket selection JS to use dynamic data attributes for URLs - Fixed CSRF protection in API and checkout payment increment - Made checkout button URLs dynamic via data attributes - Updated tests for new cart storage endpoint - Removed obsolete store_cart from EventsController
This commit is contained in:
@@ -96,11 +96,8 @@ Rails.application.routes.draw do
|
||||
namespace :api do
|
||||
namespace :v1 do
|
||||
# RESTful routes for event management
|
||||
resources :events, only: [ :index, :show, :create, :update, :destroy ] do
|
||||
member do
|
||||
post :store_cart
|
||||
end
|
||||
end
|
||||
resources :events, only: [ :index, :show, :create, :update, :destroy ]
|
||||
post "carts/store", to: "carts#store", as: "store_cart"
|
||||
|
||||
# RESTful routes for order management
|
||||
resources :orders, only: [] do
|
||||
|
||||
Reference in New Issue
Block a user