From 17927edca7237774f2e80ade5d99e9411c11317d Mon Sep 17 00:00:00 2001 From: Dzmitry Tamashevich Date: Mon, 14 Mar 2022 14:50:48 +0500 Subject: [PATCH] [Discover] apply suggestion --- src/plugins/discover/public/utils/get_sharing_data.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/discover/public/utils/get_sharing_data.ts b/src/plugins/discover/public/utils/get_sharing_data.ts index 16cb06eb69e61..b917599a02ba0 100644 --- a/src/plugins/discover/public/utils/get_sharing_data.ts +++ b/src/plugins/discover/public/utils/get_sharing_data.ts @@ -59,12 +59,12 @@ export async function getSharingData( } } + const absoluteTimeFilter = data.query.timefilter.timefilter.createFilter(index); + const relativeTimeFilter = data.query.timefilter.timefilter.createRelativeFilter(index); return { getSearchSource: (absoluteTime?: boolean): SerializedSearchSourceFields => { const absoluteFilter = data.query.timefilter.timefilter.createFilter(index); - const timeFilter = absoluteTime - ? absoluteFilter - : data.query.timefilter.timefilter.createRelativeFilter(index); + const timeFilter = absoluteTime ? absoluteTimeFilter : relativeTimeFilter; // remove timeFilter from existing filter if (Array.isArray(existingFilter)) {