Fix API call

This commit is contained in:
Adri Valle 2019-10-09 12:42:53 +02:00
parent 1a663b2ba4
commit 2312ae40f4

View File

@ -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) {