Commit 8dc817c7 authored by Kyle Muldoon's avatar Kyle Muldoon

done with AFP-68

parent 754319bc
...@@ -4,18 +4,10 @@ import { sendOrderPost } from './../util/order-api'; ...@@ -4,18 +4,10 @@ import { sendOrderPost } from './../util/order-api';
export const SEND_USER_ORDER = "SEND_USER_ORDER" export const SEND_USER_ORDER = "SEND_USER_ORDER"
const sendUserOrder = orderConfirmationResponse => ({ const sendUserOrder = (orderConfirmationResponse) => ({
type: SEND_USER_ORDER, type: SEND_USER_ORDER,
payload: orderConfirmationResponse payload: orderConfirmationResponse
}) })
export const dispatchOrderInfo = (orderInfo) => dispatch => sendOrderPost(orderInfo)
export const dispatchOrderInfo = (orderInfo) => { .then( response => dispatch(sendUserOrder(response)) )
const response = sendOrderPost(orderInfo)
return sendUserOrder(response);
}
// export const fetchAllCartItems = () => dispatch => ApiUtil.fetchCartItems()
// .then(cartItems => dispatch(receiveAllCartItems(cartItems)))
import axios from 'axios' import axios from 'axios'
export const sendOrderPost = (order) => { export const sendOrderPost = (order) => {
const response = axios.post("http://localhost:8080/api/orders", order) return axios.post("http://localhost:8080/api/orders", order)
.then((res) => res.data)
return response
} }
\ 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