mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
This commit is contained in:
parent
37eec629a1
commit
5494e04870
1 changed files with 9 additions and 5 deletions
|
@ -69,11 +69,15 @@ export function fieldsServiceProvider(callWithRequest) {
|
|||
})
|
||||
.then((resp) => {
|
||||
const aggregations = resp.aggregations;
|
||||
const results = fieldNames.reduce((obj, field) => {
|
||||
obj[field] = (aggregations[field] || { value: 0 }).value;
|
||||
return obj;
|
||||
}, {});
|
||||
resolve(results);
|
||||
if (aggregations !== undefined) {
|
||||
const results = fieldNames.reduce((obj, field) => {
|
||||
obj[field] = (aggregations[field] || { value: 0 }).value;
|
||||
return obj;
|
||||
}, {});
|
||||
resolve(results);
|
||||
} else {
|
||||
resolve({});
|
||||
}
|
||||
})
|
||||
.catch((resp) => {
|
||||
reject(resp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue