From 2464c630c46044d1394280cde7629356574a3be5 Mon Sep 17 00:00:00 2001 From: Davis McPhee Date: Thu, 27 Jul 2023 19:44:32 -0300 Subject: [PATCH] Change from toSpec to toMinimalSpec when creating saved search embeddable edit link --- .../public/embeddable/get_discover_locator_params.test.ts | 2 +- .../discover/public/embeddable/get_discover_locator_params.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/discover/public/embeddable/get_discover_locator_params.test.ts b/src/plugins/discover/public/embeddable/get_discover_locator_params.test.ts index 194264f67dbba7..54e519adddcb76 100644 --- a/src/plugins/discover/public/embeddable/get_discover_locator_params.test.ts +++ b/src/plugins/discover/public/embeddable/get_discover_locator_params.test.ts @@ -22,7 +22,7 @@ describe('getDiscoverLocatorParams', () => { const input = {} as SearchInput; expect(getDiscoverLocatorParams({ input, savedSearch: savedSearchMock })).toEqual({ dataViewId: savedSearchMock.searchSource.getField('index')?.id, - dataViewSpec: savedSearchMock.searchSource.getField('index')?.toSpec(), + dataViewSpec: savedSearchMock.searchSource.getField('index')?.toMinimalSpec(), timeRange: savedSearchMock.timeRange, refreshInterval: savedSearchMock.refreshInterval, filters: savedSearchMock.searchSource.getField('filter'), diff --git a/src/plugins/discover/public/embeddable/get_discover_locator_params.ts b/src/plugins/discover/public/embeddable/get_discover_locator_params.ts index bff3de72460060..abc5d67e9435e3 100644 --- a/src/plugins/discover/public/embeddable/get_discover_locator_params.ts +++ b/src/plugins/discover/public/embeddable/get_discover_locator_params.ts @@ -25,7 +25,7 @@ export const getDiscoverLocatorParams = ({ ? { savedSearchId: savedObjectId } : { dataViewId: dataView?.id, - dataViewSpec: dataView?.toSpec(), + dataViewSpec: dataView?.toMinimalSpec(), timeRange: savedSearch.timeRange, refreshInterval: savedSearch.refreshInterval, filters: savedSearch.searchSource.getField('filter') as Filter[],