mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 09:55:18 +00:00
Fix typo
This commit is contained in:
parent
cec63fca2b
commit
2f52a3cfb8
@ -1408,14 +1408,19 @@ export class WazuhReportingCtrl {
|
||||
let agentId = '';
|
||||
let agentOs = '';
|
||||
try {
|
||||
if (!req.payload.filters || !req.payload.filters[1] || !req.payload.filters[1].meta || !req.payload.filters[1].meta.value) {
|
||||
throw new Error(
|
||||
'Syscollector reporting needs a valid agent in order to work properly'
|
||||
);
|
||||
}
|
||||
const agent = await this.apiRequest.makeGenericRequest(
|
||||
'GET',
|
||||
`/agents/${req.payload.filters[1].meta.value}`,
|
||||
{},
|
||||
apiId
|
||||
);
|
||||
agentId = agent.data.id ? agent.data.id : req.payload.filters[1].meta.value;
|
||||
agentOs = agent.data.os.platform ? agent.data.os.platform : '';
|
||||
agentId = agent && agent.data && agent.data.id ? agent.data.id : req.payload.filters[1].meta.value;
|
||||
agentOs = agent && agent.data && agent.data.os && agent.data.os.platform ? agent.data.os.platform : '';
|
||||
} catch (err) { } //eslint-disable-line
|
||||
try {
|
||||
const packages = await this.apiRequest.makeGenericRequest(
|
||||
|
Loading…
Reference in New Issue
Block a user