diff --git a/src/plugins/data/common/search/search_source/inject_references.ts b/src/plugins/data/common/search/search_source/inject_references.ts index 286cfbd16c6e..c22da0089bc1 100644 --- a/src/plugins/data/common/search/search_source/inject_references.ts +++ b/src/plugins/data/common/search/search_source/inject_references.ts @@ -32,7 +32,7 @@ import { SavedObjectReference } from 'src/core/types'; import { SearchSourceFields } from './types'; export const injectReferences = ( - searchSourceFields: SearchSourceFields & { indexRefName: string }, + searchSourceFields: SearchSourceFields & { indexRefName?: string }, references: SavedObjectReference[] ) => { const searchSourceReturnFields: SearchSourceFields = { ...searchSourceFields }; diff --git a/src/plugins/saved_objects/public/saved_object/helpers/apply_opensearch_resp.ts b/src/plugins/saved_objects/public/saved_object/helpers/apply_opensearch_resp.ts index a7e864a49751..4fb92d87f432 100644 --- a/src/plugins/saved_objects/public/saved_object/helpers/apply_opensearch_resp.ts +++ b/src/plugins/saved_objects/public/saved_object/helpers/apply_opensearch_resp.ts @@ -91,10 +91,7 @@ export async function applyOpenSearchResp( let searchSourceValues = parseSearchSourceJSON(meta.searchSourceJSON); if (config.searchSource) { - searchSourceValues = injectSearchSourceReferences( - searchSourceValues as any, - resp.references - ); + searchSourceValues = injectSearchSourceReferences(searchSourceValues, resp.references); savedObject.searchSource = await dependencies.search.searchSource.create( searchSourceValues ); diff --git a/src/plugins/vis_builder/public/saved_visualizations/saved_visualization_references.ts b/src/plugins/vis_builder/public/saved_visualizations/saved_visualization_references.ts index 06710c4d0780..0381c5e015f1 100644 --- a/src/plugins/vis_builder/public/saved_visualizations/saved_visualization_references.ts +++ b/src/plugins/vis_builder/public/saved_visualizations/saved_visualization_references.ts @@ -13,7 +13,7 @@ export function injectReferences( ) { if (savedObject.searchSourceFields) { savedObject.searchSourceFields = injectSearchSourceReferences( - savedObject.searchSourceFields as any, + savedObject.searchSourceFields, references ); } diff --git a/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references.ts b/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references.ts index b0ee904273ab..78150615c32c 100644 --- a/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references.ts +++ b/src/plugins/visualizations/public/saved_visualizations/saved_visualization_references.ts @@ -97,7 +97,7 @@ export function extractReferences({ export function injectReferences(savedObject: VisSavedObject, references: SavedObjectReference[]) { if (savedObject.searchSourceFields) { savedObject.searchSourceFields = injectSearchSourceReferences( - savedObject.searchSourceFields as any, + savedObject.searchSourceFields, references ); }