Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <[email protected]>
  • Loading branch information
amsiglan committed Sep 20, 2024
1 parent 862209e commit 4b8a81d
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/plugins/query_enhancements/server/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,19 @@ import { API } from '../../common';
import { registerQueryAssistRoutes } from './query_assist';
import { registerDataSourceConnectionsRoutes } from './data_source_connection';

/**
* @experimental
*
* This method creates a function that will setup the routes for a search strategy by encapsulating the
* logger and router instances.
*
* @param logger - The logger instance.
* @param router - The router instance.
*/
export function defineSearchStrategyRouteProvider(logger: Logger, router: IRouter) {
/**
* @param searchStrategies - The available search strategies.
* @param searchStrategyId - The ID of the search strategy to use.
* @param id - The ID of the search strategy to use.
* @param searchStrategy
*
* @example
* API Request Body:
Expand All @@ -46,10 +55,10 @@ export function defineSearchStrategyRouteProvider(logger: Logger, router: IRoute
* ```
*/
return function (
searchStrategyId: string,
id: string,
searchStrategy: ISearchStrategy<IOpenSearchDashboardsSearchRequest, IDataFrameResponse>
) {
const path = `${API.SEARCH}/${searchStrategyId}`;
const path = `${API.SEARCH}/${id}`;
router.post(
{
path,
Expand Down

0 comments on commit 4b8a81d

Please sign in to comment.