MCPcopy Create free account
hub / github.com/basir/node-react-ecommerce / listOrders

Function listOrders

frontend/src/actions/orderActions.js:36–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36const listOrders = () => async (dispatch, getState) => {
37
38 try {
39 dispatch({ type: ORDER_LIST_REQUEST });
40 const { userSignin: { userInfo } } = getState();
41 const { data } = await Axios.get("/api/orders", {
42 headers:
43 { Authorization: 'Bearer ' + userInfo.token }
44 });
45 dispatch({ type: ORDER_LIST_SUCCESS, payload: data })
46 } catch (error) {
47 dispatch({ type: ORDER_LIST_FAIL, payload: error.message });
48 }
49}
50
51const detailsOrder = (orderId) => async (dispatch, getState) => {
52 try {

Callers 1

OrdersScreen.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected