Commit 07cb5fe4 authored by Darrick Yong's avatar Darrick Yong

add actions and utils

parent b5eeb0ed
...@@ -9,10 +9,10 @@ const receiveOrders = (payload) => ({ ...@@ -9,10 +9,10 @@ const receiveOrders = (payload) => ({
payload, payload,
}) })
const receiveOrder = (order) => ({ // const receiveOrder = (order) => ({
type: RECEIVE_ORDER, // type: RECEIVE_ORDER,
order, // order,
}) // })
export const fetchOrders = () => (dispatch) => { export const fetchOrders = () => (dispatch) => {
OrderAPIUtil.getOrders() OrderAPIUtil.getOrders()
......
...@@ -11,7 +11,7 @@ const OrderIndex = ({ orders, fetchOrders }) => { ...@@ -11,7 +11,7 @@ const OrderIndex = ({ orders, fetchOrders }) => {
setFetchAttempted(true); setFetchAttempted(true);
fetchOrders(); fetchOrders();
} }
}, [ ]) }, [fetchOrders, fetchAttempted])
return ( return (
<div> <div>
......
import axios from 'axios'; // import axios from 'axios';
const sampleRes = { const sampleRes = {
allIds: ["1", "2", "3"], allIds: ["1", "2", "3"],
......
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