From 11d1ef9b5b3eb5772af9ca8d47e0fecd8203420b Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Thu, 14 May 2020 17:34:22 +0200 Subject: [PATCH] More terse! --- .../index_management/server/lib/fetch_indices.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/index_management/server/lib/fetch_indices.ts b/x-pack/plugins/index_management/server/lib/fetch_indices.ts index 6c0d376922b62..1f62680a41cbc 100644 --- a/x-pack/plugins/index_management/server/lib/fetch_indices.ts +++ b/x-pack/plugins/index_management/server/lib/fetch_indices.ts @@ -38,17 +38,12 @@ async function fetchIndicesCall( callAsCurrentUser: CallAsCurrentUser, indexNames?: string[] ): Promise { - let indexNamesCSV: string; - if (indexNames && indexNames.length) { - indexNamesCSV = indexNames.join(','); - } else { - indexNamesCSV = '*'; - } + const indexNamesString = indexNames && indexNames.length ? indexNames.join(',') : '*'; // This call retrieves alias and settings (incl. hidden status) information about indices const indices: GetIndicesResponse = await callAsCurrentUser('transport.request', { method: 'GET', - path: `/${indexNamesCSV}`, + path: `/${indexNamesString}`, query: { expand_wildcards: 'hidden,all', }, @@ -65,7 +60,7 @@ async function fetchIndicesCall( format: 'json', h: 'health,status,index,uuid,pri,rep,docs.count,sth,store.size', expand_wildcards: 'hidden,all', - index: indexNamesCSV, + index: indexNamesString, }; // This call retrieves health and other high-level information about indices.