confirming works, last address is now persisted, thank you page is up but not yet accessible
This commit is contained in:
@@ -5,9 +5,9 @@ helpers do
|
||||
auid = cookies[:anonymous_user_id]
|
||||
if auid.nil?
|
||||
auid = AnonymousUser.uid
|
||||
response.set_cookie('anonymous_user_id', :path=> '/', :httponly => true, :value=>auid, :expires=>Time.now+100.year)
|
||||
response.set_cookie('anonymous_user_id', :path=> '/', :httponly => true, :value=>auid, :expires=> Time.now + 100.year)
|
||||
end
|
||||
auid
|
||||
return auid
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,7 +22,6 @@ get '/cart/item' do
|
||||
Cart.find_or_create(anonymous_id, -1).item_in_carts.to_json
|
||||
end
|
||||
|
||||
|
||||
update_cart_item = ->() {
|
||||
cart_id = Cart.find_or_create(anonymous_id, -1).id
|
||||
item_id = @json_params["item_id"].to_i
|
||||
@@ -58,4 +57,13 @@ update_delivery_destination = ->() {
|
||||
cart.delivery_destination.to_json(:except => [:created_at, :email_verification_code, :phone_verification_code])
|
||||
}
|
||||
put '/cart/delivery_destination', &update_delivery_destination
|
||||
post '/cart/delivery_destination', &update_delivery_destination
|
||||
post '/cart/delivery_destination', &update_delivery_destination
|
||||
|
||||
|
||||
post '/cart/confirmation' do
|
||||
cart = Cart.find_or_create(anonymous_id, -1)
|
||||
if cart.item_in_carts.length > 0
|
||||
cart.ordered = true
|
||||
cart.save!
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user