Commit cb9f4636 authored by Xiyang Lu's avatar Xiyang Lu

resolve pull conflict

parent b2672ad5
......@@ -18,6 +18,4 @@ public class OrdersController {
private Mono<Order> postOrder(@RequestBody OrderRequest orderRequest){
return orderService.postOrder(orderRequest);
}
}
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
})
......@@ -16,10 +16,6 @@ export default class Session extends Component {
this.logOutSuccess = this.logOutSuccess.bind(this)
}
// componentDidMount(){
// this.props.logOut()
// }
loginSuccess = (response) => {
const {accessToken, tokenId, googleId: userId, profileObj} = response
const {email, familyName: lastName, givenName: firstName} = profileObj
......
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 axios from 'axios';
export const postCart = (data) => {
return axios.post("http://localhost:8080/api/carts", data)
}
export const getCartById = (id) => {
return axios.get("http://localhost:8080/api/carts", {
params: {
userId: id
}
})
}
\ No newline at end of file
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