From 2312ae40f4c24fc4adf3f02f66311263f73e1b66 Mon Sep 17 00:00:00 2001 From: Adri Valle Date: Wed, 9 Oct 2019 12:42:53 +0200 Subject: [PATCH] Fix API call --- public/controllers/agent/agents-preview.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/public/controllers/agent/agents-preview.js b/public/controllers/agent/agents-preview.js index 9f23f7861..3b1c2cad3 100644 --- a/public/controllers/agent/agents-preview.js +++ b/public/controllers/agent/agents-preview.js @@ -315,12 +315,10 @@ export class AgentsPreviewController { */ async getCurrentApiAddress() { try { - const result = await this.genericReq.request('GET', '/elastic/apis'); + const result = await this.genericReq.request('GET', '/hosts/apis'); const entries = result.data || []; - const host = entries.filter(e => { - return e._id == this.api; - }); - const url = host[0]._source.url; + const host = entries.filter(e => {return e.id == this.api}); + const url = host[0].url; const numToClean = url.startsWith('https://') ? 8 : 7; return url.substr(numToClean); } catch (error) {