Pick Infra UI from #166813 (#167348)

## Summary

We're breaking https://github.com/elastic/kibana/pull/166813 up into
smaller PRs in the interest of getting PRs through sooner for type
fixes. These are the changes for Infra UI.
This commit is contained in:
Brad White 2023-09-27 03:42:54 -06:00 committed by GitHub
parent cd962314d7
commit 077e87b514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,12 +47,15 @@ export function hostsRoutes<T extends RequestHandlerContext>({
async (context, req, res) => {
const { from = 'now-24h', to = 'now' } = req.query || {};
const esClient = await getEsClientFromContext(context);
const coreContext = await context.core;
const soClient = coreContext.savedObjects.client;
try {
const response = await assetAccessor.getHosts({
from: datemath.parse(from)!.toISOString(),
to: datemath.parse(to)!.toISOString(),
esClient,
soClient,
});
return res.ok({ body: response });