add full output from Wazuh-api

This commit is contained in:
Pablo 2019-01-11 10:01:40 +01:00
parent b887824b1b
commit 77eed61d09

View File

@ -517,18 +517,20 @@ export class DevToolsController {
const path = req.includes('?') ? req.split('?')[0] : req;
if (typeof JSONraw === 'object') JSONraw.devTools = true;
console.log("a")
const output = await this.apiReq.request(method, path, JSONraw);
console.log(output)
this.apiOutputBox.setValue(JSON.stringify(output.data.data, null, 2));
this.apiOutputBox.setValue(JSON.stringify(output.data, null, 2));
} else {
this.apiOutputBox.setValue('Welcome!');
}
} catch (error) {
const parsedError = this.errorHandler.handle(error, null, null, true);
if (typeof parsedError === 'string') {
return this.apiOutputBox.setValue(parsedError);
return this.apiOutputBox.setValue(error);
} else if (error && error.data && typeof error.data === 'object') {
return this.apiOutputBox.setValue(JSON.stringify(error.data));
return this.apiOutputBox.setValue(JSON.stringify(error));
} else {
return this.apiOutputBox.setValue('Empty');
}