address saving almost works

This commit is contained in:
Senad Uka
2015-02-26 06:48:34 +01:00
parent 6e327c758f
commit 1ca7d4509a
10 changed files with 618 additions and 571 deletions

View File

@@ -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;
}