Skip to content

Commit

Permalink
Fixed find api
Browse files Browse the repository at this point in the history
  • Loading branch information
YulNaumenko committed May 28, 2020
1 parent ee17ee3 commit ea75836
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/alerts/server/alerts_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class AlertsClient {
}
}

public async find(options: FindOptions = {}): Promise<FindResult> {
public async find({ options = {} }: { options: FindOptions }): Promise<FindResult> {
const {
page,
per_page: perPage,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/alerts/server/routes/find.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const findAlertRoute = (router: IRouter, licenseState: LicenseState) => {
: [query.search_fields];
}

const findResult = await alertsClient.find(options);
const findResult = await alertsClient.find({ options });
return res.ok({
body: findResult,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface InfraServerPluginDeps {
visTypeTimeseries: VisTypeTimeseriesSetup;
features: FeaturesPluginSetup;
apm: APMPluginSetup;
alerting: AlertingPluginContract;
alerts: AlertingPluginContract;
}

export interface CallWithRequestParams extends GenericParams {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/infra/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class InfraServerPlugin {
]);

initInfraServer(this.libs);
registerAlertTypes(plugins.alerting, this.libs);
registerAlertTypes(plugins.alerts, this.libs);

// Telemetry
UsageCollector.registerUsageCollector(plugins.usageCollection);
Expand Down

0 comments on commit ea75836

Please sign in to comment.