Fix search profiler (#27326)

* fix logic for when license error shows

* fix API route to work with latest hapi API
This commit is contained in:
Bill McConaghy 2018-12-17 14:39:46 -05:00 committed by GitHub
parent faa57fd7a9
commit b0c6b52b45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -18,7 +18,7 @@
</tabset>
<!-- License error notice -->
<div class="kuiNotice" ng-hide="!licenseEnabled">
<div class="kuiNotice" ng-hide="licenseEnabled">
<h2
class="kuiTitle kuiVerticalRhythmSmall"
i18n-id="xpack.searchProfiler.licenseErrorMessageTitle"

View file

@ -21,7 +21,7 @@ export function profileRoute(server, commonRouteConfig) {
}).required() //Joi validation
}
},
handler: (request) => {
handler: async (request) => {
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');
let parsed = request.payload.query;
@ -33,18 +33,18 @@ export function profileRoute(server, commonRouteConfig) {
type: request.payload.type,
body: parsed
};
callWithRequest(request, 'search', body).then((resp) => {
try {
const resp = await callWithRequest(request, 'search', body);
return {
ok: true,
resp: resp
};
}).catch((err) => {
} catch (err) {
return {
ok: false,
err: err
};
});
}
}
});