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({
|
||||
actionType: CartConstants.SET_ITEM_COUNT,
|
||||
actionType: CartConstants.ADD_N_ITEMS,
|
||||
item: item,
|
||||
count: count
|
||||
});
|
||||
|
||||
@@ -75,7 +75,7 @@ var AddToCart = React.createClass({
|
||||
},
|
||||
|
||||
_addToCartClick: function () {
|
||||
CartActions.setItemCount(this.props.item, this.state.count);
|
||||
CartActions.addNItems(this.props.item, this.state.count);
|
||||
},
|
||||
|
||||
componentWillUnmount: function () {
|
||||
|
||||
@@ -8,5 +8,6 @@ module.exports = keyMirror({
|
||||
CHANGE_DELIVERY_DESTINATION_PROPERTY: null,
|
||||
CONFIRM_DELIVERY: null,
|
||||
SET_ITEM_COUNT: null,
|
||||
ADD_N_ITEMS: 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 state = states[itemId] || new ItemInCart({
|
||||
@@ -290,8 +290,8 @@ AppDispatcher.register(function(payload) {
|
||||
case CartConstants.CONFIRM_DELIVERY:
|
||||
saveDeliveryDestination();
|
||||
break;
|
||||
case CartConstants.SET_ITEM_COUNT:
|
||||
setItemCount(action.item, action.count);
|
||||
case CartConstants.ADD_N_ITEMS:
|
||||
addNItems(action.item, action.count);
|
||||
break;
|
||||
default:
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user