apply changes from order helper
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user