Skip to content

Commit

Permalink
fix plugin functional
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Oct 12, 2020
1 parent 0ef83ad commit a663b12
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/plugin_functional/plugins/data_search/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ export class DataSearchTestPlugin
},
},
async (context, req, res) => {
const [, { data }] = await core.getStartServices();
const [{ savedObjects }, { data }] = await core.getStartServices();
const service = await data.search.searchSource.asScoped(req);
const savedObjectsClient = savedObjects.getScopedClient(req);

// Since the index pattern ID can change on each test run, we need
// to look it up on the fly and insert it into the request.
const indexPatterns = await data.indexPatterns.indexPatternsServiceFactory(req);
const indexPatterns = await data.indexPatterns.indexPatternsServiceFactory(
savedObjectsClient
);
const ids = await indexPatterns.getIds();
// @ts-expect-error Force overwriting the request
req.body.index = ids[0];
Expand Down

0 comments on commit a663b12

Please sign in to comment.