---------

**Commit 1:**
[ingest/register_fields_capabilities] prevent calling reply() twice

* Original sha: e06e659035
* Authored by spalger <email@spalger.com> on 2016-09-30T12:29:46Z
This commit is contained in:
Elastic Jasper 2016-10-13 17:33:37 -04:00
parent aad5e9a5fe
commit da19bc1683

View file

@ -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));
}
);
}
});
}