always return array from problems requests

This commit is contained in:
Alexander Zobnin
2020-05-27 09:55:57 +03:00
parent 938b3cdc05
commit d2a1a7797b
4 changed files with 14 additions and 6 deletions

View File

@@ -340,7 +340,10 @@ export class Zabbix implements ZabbixConnector {
.then(query => this.zabbixAPI.getProblems(query.groupids, query.hostids, query.applicationids, options))
.then(problems => {
const triggerids = problems?.map(problem => problem.objectid);
return Promise.all([Promise.resolve(problems), this.zabbixAPI.getTriggersByIds(triggerids)]);
return Promise.all([
Promise.resolve(problems),
this.zabbixAPI.getTriggersByIds(triggerids)
]);
})
.then(([problems, triggers]) => joinTriggersWithProblems(problems, triggers))
.then(triggers => this.filterTriggersByProxy(triggers, proxyFilter))