mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 09:55:18 +00:00
Showing all details if validation fails
This commit is contained in:
parent
b9578bbad6
commit
d0ba771535
@ -60,10 +60,12 @@ export class ConfigHandler {
|
||||
{}
|
||||
);
|
||||
|
||||
const valid =
|
||||
(((validationError || {}).data || {}).data || {}).status === 'OK';
|
||||
if (!valid) {
|
||||
throw new Error('The configuration has some error.');
|
||||
const data = ((validationError || {}).data || {}).data || {};
|
||||
const isOk = data.status === 'OK';
|
||||
if (!isOk && Array.isArray(data.details)) {
|
||||
let str = '';
|
||||
for (const detail of data.details) str += detail;
|
||||
throw new Error(str);
|
||||
}
|
||||
|
||||
const result = await this.apiReq.request('PUT', `/manager/restart`, {});
|
||||
@ -84,10 +86,12 @@ export class ConfigHandler {
|
||||
{}
|
||||
);
|
||||
|
||||
const valid =
|
||||
(((validationError || {}).data || {}).data || {}).status === 'OK';
|
||||
if (!valid) {
|
||||
throw new Error('The configuration has some error.');
|
||||
const data = ((validationError || {}).data || {}).data || {};
|
||||
const isOk = data.status === 'OK';
|
||||
if (!isOk && Array.isArray(data.details)) {
|
||||
let str = '';
|
||||
for (const detail of data.details) str += detail;
|
||||
throw new Error(str);
|
||||
}
|
||||
|
||||
const result = await this.apiReq.request('PUT', `/cluster/restart`, {});
|
||||
@ -108,10 +112,12 @@ export class ConfigHandler {
|
||||
{}
|
||||
);
|
||||
|
||||
const valid =
|
||||
(((validationError || {}).data || {}).data || {}).status === 'OK';
|
||||
if (!valid) {
|
||||
throw new Error('The configuration has some error.');
|
||||
const data = ((validationError || {}).data || {}).data || {};
|
||||
const isOk = data.status === 'OK';
|
||||
if (!isOk && Array.isArray(data.details)) {
|
||||
let str = '';
|
||||
for (const detail of data.details) str += detail;
|
||||
throw new Error(str);
|
||||
}
|
||||
|
||||
const result = await this.apiReq.request(
|
||||
|
Loading…
Reference in New Issue
Block a user