Commit 08831eb5 authored by Xiyang Lu's avatar Xiyang Lu

resolve conflict

parent e01ef5cd
<<<<<<< HEAD
import {postCart} from '../util/cart_api_util'
export const ADD_NEW_CART = "ADD_NEW_CART"
export const RECEIVE_CART = "RECEIVE_CART"
export const addNewCart = cart => ({
type: ADD_NEW_CART,
cart
})
export const receieveCart = cart => ({
type: RECEIVE_CART,
cart
})
=======
import * as ApiUtil from '../util/cart_api_util';
export const RECEIVE_USER_CART = "RECEIVE_USER_CART";
......@@ -37,4 +20,3 @@ export const updateUserCart = (updatedCart, userEmail) => dispatch => ApiUtil.up
export const createUserCart = newCart => dispatch => ApiUtil.createCart(newCart)
.then(res => res.json)
>>>>>>> 1f99e20fa13caaa629b4886d2be1b9d96bb9aa82
<<<<<<< HEAD
import {ADD_NEW_CART, RECEIVE_CART} from '../actions/cart_actions'
const initialState = {
user: null,
cartItems: []
}
const cartReducer = (prevState = initialState, action) => {
Object.freeze(prevState);
const nextState = {...prevState};
switch (action.type) {
case RECEIVE_CART:
nextState.user = "user"
nextState.cartItems = ["dafsd","fasdfa"]
return nextState;
case ADD_NEW_CART:
nextState.user = "action.products.data"
nextState.cartItems = []
return nextState;
default:
return nextState;
}
}
export default cartReducer;
=======
import { RECEIVE_USER_CART, CLEAR_USER_CART } from '../actions/cart_actions';
const initialState = []
......@@ -47,4 +16,3 @@ const cartReducer = (state = initialState, action) => {
}
export default cartReducer;
>>>>>>> 1f99e20fa13caaa629b4886d2be1b9d96bb9aa82
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment