Table queries: remove befor/after from no interval endpoints
This commit is contained in:
parent
241ebb63ff
commit
4aab25b8ba
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue