Reduce unread orders API response fields.
This commit is contained in:
parent
9bbc4fa96d
commit
705379bdbb
|
@ -279,6 +279,7 @@ export default compose(
|
||||||
page: 1,
|
page: 1,
|
||||||
per_page: QUERY_DEFAULTS.pageSize,
|
per_page: QUERY_DEFAULTS.pageSize,
|
||||||
status: orderStatuses,
|
status: orderStatuses,
|
||||||
|
_fields: [ 'id', 'date_created_gmt', 'status' ],
|
||||||
};
|
};
|
||||||
const actionableOrders = Array.from( getItems( 'orders', allOrdersQuery ).values() );
|
const actionableOrders = Array.from( getItems( 'orders', allOrdersQuery ).values() );
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ export function getUnreadNotes( select ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUnreadOrders( select ) {
|
export function getUnreadOrders( select ) {
|
||||||
const { getItemsTotalCount, getItemsError, isGetItemsRequesting } = select( 'wc-api' );
|
const { getItems, getItemsTotalCount, getItemsError, isGetItemsRequesting } = select( 'wc-api' );
|
||||||
const orderStatuses =
|
const orderStatuses =
|
||||||
wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses || DEFAULT_ACTIONABLE_STATUSES;
|
wcSettings.wcAdminSettings.woocommerce_actionable_order_statuses || DEFAULT_ACTIONABLE_STATUSES;
|
||||||
|
|
||||||
|
@ -44,8 +44,10 @@ export function getUnreadOrders( select ) {
|
||||||
page: 1,
|
page: 1,
|
||||||
per_page: 1, // Core endpoint requires per_page > 0.
|
per_page: 1, // Core endpoint requires per_page > 0.
|
||||||
status: orderStatuses,
|
status: orderStatuses,
|
||||||
|
_fields: [ 'id' ],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
getItems( 'orders', ordersQuery );
|
||||||
const totalOrders = getItemsTotalCount( 'orders', ordersQuery );
|
const totalOrders = getItemsTotalCount( 'orders', ordersQuery );
|
||||||
const isError = Boolean( getItemsError( 'orders', ordersQuery ) );
|
const isError = Boolean( getItemsError( 'orders', ordersQuery ) );
|
||||||
const isRequesting = isGetItemsRequesting( 'orders', ordersQuery );
|
const isRequesting = isGetItemsRequesting( 'orders', ordersQuery );
|
||||||
|
|
Loading…
Reference in New Issue