Skip to content

Commit

Permalink
fix: πŸ› try fixing integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Dec 3, 2020
1 parent 9d54c5e commit cce1c9a
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/plugins/data/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,21 @@ export class DataServerPlugin
core.http.registerRouteHandlerContext(
'indexPatterns',
async (context): Promise<Partial<IndexPatternsRequestHandlerContext>> => {
const savedObjectsClient = context.core.savedObjects.client;
const elasticsearchClient = context.core.elasticsearch.client.asCurrentUser;

const indexPatterns = await this.indexPatterns.createIndexPatternsService(
savedObjectsClient,
elasticsearchClient
);

return {
indexPatterns,
};
try {
const savedObjectsClient = context.core.savedObjects.client;
const elasticsearchClient = context.core.elasticsearch.client.asCurrentUser;

const indexPatterns = await this.indexPatterns.createIndexPatternsService(
savedObjectsClient,
elasticsearchClient
);

return {
indexPatterns,
};
} catch {
return {};
}
}
);

Expand Down

0 comments on commit cce1c9a

Please sign in to comment.