fixed misleading name of an action
This commit is contained in:
@@ -10,9 +10,9 @@ var CartActions = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
setItemCount: function(item, count) {
|
addNItems: function(item, count) {
|
||||||
AppDispatcher.handleAction({
|
AppDispatcher.handleAction({
|
||||||
actionType: CartConstants.SET_ITEM_COUNT,
|
actionType: CartConstants.ADD_N_ITEMS,
|
||||||
item: item,
|
item: item,
|
||||||
count: count
|
count: count
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ var AddToCart = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_addToCartClick: function () {
|
_addToCartClick: function () {
|
||||||
CartActions.setItemCount(this.props.item, this.state.count);
|
CartActions.addNItems(this.props.item, this.state.count);
|
||||||
},
|
},
|
||||||
|
|
||||||
componentWillUnmount: function () {
|
componentWillUnmount: function () {
|
||||||
|
|||||||
@@ -8,5 +8,6 @@ module.exports = keyMirror({
|
|||||||
CHANGE_DELIVERY_DESTINATION_PROPERTY: null,
|
CHANGE_DELIVERY_DESTINATION_PROPERTY: null,
|
||||||
CONFIRM_DELIVERY: null,
|
CONFIRM_DELIVERY: null,
|
||||||
SET_ITEM_COUNT: null,
|
SET_ITEM_COUNT: null,
|
||||||
|
ADD_N_ITEMS: null,
|
||||||
REMOVE_ITEM: null
|
REMOVE_ITEM: null
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ var takeItemOut = function(itemId) {
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var setItemCount = function(item, count) {
|
var addNItems = function(item, count) {
|
||||||
|
|
||||||
var itemId = item.get('id');
|
var itemId = item.get('id');
|
||||||
var state = states[itemId] || new ItemInCart({
|
var state = states[itemId] || new ItemInCart({
|
||||||
@@ -290,8 +290,8 @@ AppDispatcher.register(function(payload) {
|
|||||||
case CartConstants.CONFIRM_DELIVERY:
|
case CartConstants.CONFIRM_DELIVERY:
|
||||||
saveDeliveryDestination();
|
saveDeliveryDestination();
|
||||||
break;
|
break;
|
||||||
case CartConstants.SET_ITEM_COUNT:
|
case CartConstants.ADD_N_ITEMS:
|
||||||
setItemCount(action.item, action.count);
|
addNItems(action.item, action.count);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user