From 0bb2f7c7d87fadcc27335e855bf6d83719e93879 Mon Sep 17 00:00:00 2001 From: vignesh-reddy <53308402+vignesh-reddy@users.noreply.github.com> Date: Thu, 12 Dec 2019 02:48:03 -0600 Subject: [PATCH] Backend: handle response on the frontend (#839) --- .../zabbix_api/zabbixAPIConnector.js | 22 +++---------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/src/datasource-zabbix/zabbix/connectors/zabbix_api/zabbixAPIConnector.js b/src/datasource-zabbix/zabbix/connectors/zabbix_api/zabbixAPIConnector.js index f9229bf..ac449e5 100644 --- a/src/datasource-zabbix/zabbix/connectors/zabbix_api/zabbixAPIConnector.js +++ b/src/datasource-zabbix/zabbix/connectors/zabbix_api/zabbixAPIConnector.js @@ -40,26 +40,10 @@ export class ZabbixAPIConnector { ////////////////////////// request(method, params) { - this.tsdbRequest(method, params).then(response => { + return this.tsdbRequest(method, params).then(response => { const result = this.handleTsdbResponse(response); - console.log(result); - }); - - return this.zabbixAPICore.request(this.url, method, params, this.requestOptions, this.auth) - .catch(error => { - if (isNotAuthorized(error.data)) { - // Handle auth errors - this.loginErrorCount++; - if (this.loginErrorCount > this.maxLoginAttempts) { - this.loginErrorCount = 0; - return null; - } else { - return this.loginOnce() - .then(() => this.request(method, params)); - } - } else { - return Promise.reject(error); - } + + return result; }); }