Merge pull request woocommerce/woocommerce-admin#2422 from woocommerce/fix/no-interval-table-queries

Table queries: remove befor/after from no interval endpoints
This commit is contained in:
Paul Sealock 2019-06-14 20:13:41 +12:00 committed by GitHub
commit 3b507d52fc
1 changed files with 4 additions and 2 deletions

View File

@ -342,11 +342,13 @@ export function getReportTableQuery( options ) {
const filterQuery = getFilterQuery( options ); const filterQuery = getFilterQuery( options );
const datesFromQuery = getCurrentDates( query ); const datesFromQuery = getCurrentDates( query );
const noIntervals = includes( noIntervalEndpoints, options.endpoint );
return { return {
orderby: query.orderby || 'date', orderby: query.orderby || 'date',
order: query.order || 'desc', order: query.order || 'desc',
after: appendTimestamp( datesFromQuery.primary.after, 'start' ), after: noIntervals ? undefined : appendTimestamp( datesFromQuery.primary.after, 'start' ),
before: appendTimestamp( datesFromQuery.primary.before, 'end' ), before: noIntervals ? undefined : appendTimestamp( datesFromQuery.primary.before, 'end' ),
page: query.page || 1, page: query.page || 1,
per_page: query.per_page || QUERY_DEFAULTS.pageSize, per_page: query.per_page || QUERY_DEFAULTS.pageSize,
...filterQuery, ...filterQuery,