Work on wiaas orders
This commit is contained in:
@@ -23,12 +23,10 @@ export const getActiveOrders = () => {
|
||||
return dispatch => {
|
||||
dispatch(requestActiveOrders());
|
||||
return htmlClient.fetch({
|
||||
url: `${API_SERVER}/orders/api/getActiveOrders`
|
||||
url: `${API_SERVER}/wp-json/wc/v2/orders?status=processing`
|
||||
})
|
||||
.then(response => {
|
||||
if (typeof response.data !== 'undefined' && 'orders' in response.data) {
|
||||
dispatch(recieveActiveOrders(response.data.orders));
|
||||
}
|
||||
dispatch(recieveActiveOrders(response.data));
|
||||
})
|
||||
.catch(error => {
|
||||
htmlClient.onError(error, dispatch);
|
||||
@@ -50,12 +48,10 @@ export const getHistoryOrders = () => {
|
||||
return dispatch => {
|
||||
dispatch(requestHistoryOrders());
|
||||
return htmlClient.fetch({
|
||||
url: `${API_SERVER}/orders/api/getHistoryOrders`
|
||||
url: `${API_SERVER}/wp-json/wc/v2/orders?status=completed`
|
||||
})
|
||||
.then(response => {
|
||||
if (typeof response.data !== 'undefined' && 'orders' in response.data) {
|
||||
dispatch(recieveHistoryOrders(response.data.orders));
|
||||
}
|
||||
dispatch(recieveHistoryOrders(response.data));
|
||||
})
|
||||
.catch(error => {
|
||||
htmlClient.onError(error, dispatch);
|
||||
|
||||
Reference in New Issue
Block a user