Skip to content

Commit

Permalink
Fix request.query typing
Browse files Browse the repository at this point in the history
- API endpoints passing in custom request.query params were seeing {} type errors - this change works around them
  • Loading branch information
cee-chen committed Sep 9, 2020
1 parent e6bb08c commit 5b84f79
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ interface IRequestParams<ResponseBody> {
hasValidData?: (body?: ResponseBody) => boolean;
}
export interface IEnterpriseSearchRequestHandler {
createRequest(requestParams?: object): RequestHandler<unknown, Readonly<{}>, unknown>;
createRequest(requestParams?: object): RequestHandler<unknown, unknown, unknown>;
}

/**
Expand All @@ -52,12 +52,12 @@ export class EnterpriseSearchRequestHandler {
}: IRequestParams<ResponseBody>) {
return async (
_context: RequestHandlerContext,
request: KibanaRequest<unknown, Readonly<{}>, unknown>,
request: KibanaRequest<unknown, unknown, unknown>,
response: KibanaResponseFactory
) => {
try {
// Set up API URL
const queryParams = { ...request.query, ...params };
const queryParams = { ...(request.query as object), ...params };
const queryString = !this.isEmptyObj(queryParams)
? `?${querystring.stringify(queryParams)}`
: '';
Expand Down

0 comments on commit 5b84f79

Please sign in to comment.