limit number of orders
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
RECEIVE_ORDERS
|
||||
} from '../../constants/dashboardConstants';
|
||||
import SaburlyAdapter from '../../helpers/SaburlyAdapter';
|
||||
import { MAX_ORDER_COUNT } from '../../constants/ordersConstants';
|
||||
const htmlClient = new HtmlClient();
|
||||
const saburlyAdapter = new SaburlyAdapter();
|
||||
|
||||
@@ -23,8 +24,8 @@ export const fetchOrders = (viewAllOrders) => {
|
||||
return dispatch => {
|
||||
dispatch(requestOrders());
|
||||
return htmlClient.fetch({
|
||||
url: `${API_SERVER}/wp-json/wc/v2/orders`,
|
||||
method: 'get'
|
||||
url: `${API_SERVER}/wp-json/wc/v2/orders?per_page=${MAX_ORDER_COUNT}`,
|
||||
method: 'get',
|
||||
})
|
||||
.then(response => {
|
||||
const transformedOrdersArray = saburlyAdapter.transformOrdersArray(response.data);
|
||||
|
||||
@@ -207,3 +207,5 @@ export const orderTexts = {
|
||||
PLACED_BY: 'Placed by'
|
||||
}
|
||||
};
|
||||
|
||||
export const MAX_ORDER_COUNT = 5;
|
||||
|
||||
Reference in New Issue
Block a user