From 2a0726d256008681921c8a51a0c760bc185d5011 Mon Sep 17 00:00:00 2001 From: GotPPay Date: Wed, 8 Aug 2018 16:46:59 +0200 Subject: [PATCH] apply changes from order helper --- frontend/src/actions/dashboard/ordersActions.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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);