Skip to content

Commit 6a1be60

Browse files
committed
tslint
1 parent 4d03ac4 commit 6a1be60

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

examples/controls_example/public/react_controls/data_controls/range_slider/has_no_results.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Side Public License, v 1.
77
*/
88

9+
import { estypes } from '@elastic/elasticsearch';
910
import { DataPublicPluginStart } from '@kbn/data-plugin/public';
1011
import { DataView } from '@kbn/data-views-plugin/public';
1112
import { AggregateQuery, Filter, Query, TimeRange } from '@kbn/es-query';
@@ -110,6 +111,6 @@ async function hasNoResults({
110111
legacyHitsTotal: false,
111112
})
112113
);
113-
const count = resp?.rawResponse?.hits?.total?.value;
114+
const count = (resp?.rawResponse?.hits?.total as estypes.SearchTotalHits)?.value;
114115
return typeof count === 'number' && count === 0;
115116
}

examples/controls_example/public/react_controls/data_controls/range_slider/min_max.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Side Public License, v 1.
77
*/
88

9+
import { estypes } from '@elastic/elasticsearch';
910
import { DataPublicPluginStart } from '@kbn/data-plugin/public';
1011
import { DataView, DataViewField } from '@kbn/data-views-plugin/public';
1112
import { AggregateQuery, Filter, Query, TimeRange } from '@kbn/es-query';
@@ -118,7 +119,11 @@ export async function getMinMax({
118119

119120
const resp = await lastValueFrom(searchSource.fetch$({ abortSignal }));
120121
return {
121-
min: resp.rawResponse?.aggregations?.minAgg?.value,
122-
max: resp.rawResponse?.aggregations?.maxAgg?.value,
122+
min:
123+
(resp.rawResponse?.aggregations?.minAgg as estypes.AggregationsSingleMetricAggregateBase)
124+
?.value ?? undefined,
125+
max:
126+
(resp.rawResponse?.aggregations?.maxAgg as estypes.AggregationsSingleMetricAggregateBase)
127+
?.value ?? undefined,
123128
};
124129
}

0 commit comments

Comments
 (0)