address saving almost works
This commit is contained in:
@@ -43,6 +43,11 @@ var CartActions = {
|
||||
property: property,
|
||||
value: value
|
||||
});
|
||||
},
|
||||
confirmDelivery: function() {
|
||||
AppDispatcher.handleAction({
|
||||
actionType: CartConstants.CONFIRM_DELIVERY,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,5 +9,6 @@ module.exports = keyMirror({
|
||||
TAKE_ITEM_OUT: null ,
|
||||
CART_DATA_LOADED: null,
|
||||
SAVE_CART_STATE_FOR_ITEM: null,
|
||||
CHANGE_DELIVERY_DESTINATION_PROPERTY: null
|
||||
CHANGE_DELIVERY_DESTINATION_PROPERTY: null,
|
||||
CONFIRM_DELIVERY: null
|
||||
});
|
||||
|
||||
@@ -34,6 +34,11 @@ var loadCart = function() {
|
||||
CartActions.dataLoaded();
|
||||
}
|
||||
})
|
||||
_deliveryDestination.fetch({
|
||||
success: function() {
|
||||
CartActions.dataLoaded();
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
@@ -74,7 +79,13 @@ var changeDeliveryDestinationProperty = function (property, value) {
|
||||
_deliveryDestination.set(property, value);
|
||||
};
|
||||
|
||||
|
||||
var saveDeliveryDestination = function() {
|
||||
_deliveryDestination.save({
|
||||
success: function() {
|
||||
CartActions.dataLoaded();
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
// Extend CartStore with EventEmitter to add eventing capabilities
|
||||
@@ -156,6 +167,8 @@ AppDispatcher.register(function(payload) {
|
||||
break;
|
||||
case CartConstants.CHANGE_DELIVERY_DESTINATION_PROPERTY:
|
||||
changeDeliveryDestinationProperty(action.propety, action.value)
|
||||
case CartConstants.CONFIRM_DELIVERY:
|
||||
saveDeliveryDestination();
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user