From 4d4d6361ea791069ba6d418cc205ab078577eafa Mon Sep 17 00:00:00 2001 From: James Gowdy Date: Thu, 9 Dec 2021 10:30:26 +0000 Subject: [PATCH] [ML] Fixing data view search based on title (#120737) (#120781) * [ML] Fixing data view search based on title * removing size argument # Conflicts: # x-pack/plugins/ml/server/lib/alerts/alerting_service.ts --- x-pack/plugins/ml/public/application/util/index_utils.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/ml/public/application/util/index_utils.ts b/x-pack/plugins/ml/public/application/util/index_utils.ts index 5d35081dcb0fc..503c20dfc5bdb 100644 --- a/x-pack/plugins/ml/public/application/util/index_utils.ts +++ b/x-pack/plugins/ml/public/application/util/index_utils.ts @@ -48,11 +48,12 @@ export async function getDataViewIdFromName(name: string): Promise title === name); + if (!dataView) { return null; } - return dv.id ?? dv.title; + return dataView.id ?? dataView.title; } export function getDataViewById(id: string): Promise {