mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Merge pull request #8674 from elastic/jasper/backport/8505/5.0
[backport] PR #8505 to 5.0 - [ingest/register_fields_capabilities] prevent calling reply() twice
This commit is contained in:
commit
44d2a4c153
1 changed files with 12 additions and 10 deletions
|
@ -15,17 +15,19 @@ export function registerFieldCapabilities(server) {
|
|||
index: indices,
|
||||
allowNoIndices: false
|
||||
})
|
||||
.catch((error) => {
|
||||
reply(handleESError(error));
|
||||
})
|
||||
.then((res) => {
|
||||
const fields = _.get(res, 'indices._all.fields', {});
|
||||
const fieldsFilteredValues = _.mapValues(fields, (value) => {
|
||||
return _.pick(value, ['searchable', 'aggregatable']);
|
||||
});
|
||||
.then(
|
||||
(res) => {
|
||||
const fields = _.get(res, 'indices._all.fields', {});
|
||||
const fieldsFilteredValues = _.mapValues(fields, (value) => {
|
||||
return _.pick(value, ['searchable', 'aggregatable']);
|
||||
});
|
||||
|
||||
reply({fields: fieldsFilteredValues});
|
||||
});
|
||||
reply({fields: fieldsFilteredValues});
|
||||
},
|
||||
(error) => {
|
||||
reply(handleESError(error));
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue