Table queries: remove befor/after from no interval endpoints

This commit is contained in:
Paul Sealock 2019-06-14 06:21:35 +12:00
parent 241ebb63ff
commit 4aab25b8ba
1 changed files with 4 additions and 2 deletions

View File

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