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

Function detailsOrder

frontend/src/actions/orderActions.js:51–63  ·  view source on GitHub ↗
(orderId)

Source from the content-addressed store, hash-verified

49}
50
51const detailsOrder = (orderId) => async (dispatch, getState) => {
52 try {
53 dispatch({ type: ORDER_DETAILS_REQUEST, payload: orderId });
54 const { userSignin: { userInfo } } = getState();
55 const { data } = await Axios.get("/api/orders/" + orderId, {
56 headers:
57 { Authorization: 'Bearer ' + userInfo.token }
58 });
59 dispatch({ type: ORDER_DETAILS_SUCCESS, payload: data })
60 } catch (error) {
61 dispatch({ type: ORDER_DETAILS_FAIL, payload: error.message });
62 }
63}
64
65const payOrder = (order, paymentResult) => async (dispatch, getState) => {
66 try {

Callers 1

OrderScreenFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected