diff --git a/frontend/src/actions/dashboard/ordersActions.js b/frontend/src/actions/dashboard/ordersActions.js index c9315c1..856a655 100644 --- a/frontend/src/actions/dashboard/ordersActions.js +++ b/frontend/src/actions/dashboard/ordersActions.js @@ -4,10 +4,9 @@ import { REQUEST_ORDERS, RECEIVE_ORDERS } from '../../constants/dashboardConstants'; -import SaburlyAdapter from '../../helpers/SaburlyAdapter'; +import {fromWCOrder} from '../../helpers/OrderHelper'; import { MAX_ORDER_COUNT } from '../../constants/ordersConstants'; const htmlClient = new HtmlClient(); -const saburlyAdapter = new SaburlyAdapter(); export const requestOrders = () => ({ type: REQUEST_ORDERS, @@ -28,8 +27,10 @@ export const fetchOrders = (viewAllOrders) => { method: 'get', }) .then(response => { - const transformedOrdersArray = saburlyAdapter.transformOrdersArray(response.data); - dispatch(recieveOrders(transformedOrdersArray)); + const transformedFromWCOrders = response.data.map(order=>{ + return fromWCOrder(order); + }); + dispatch(recieveOrders(transformedFromWCOrders)); }) .catch(error => { htmlClient.onError(error, dispatch);