From 738961575d677f69ed65c3a72234226f7599bc7c Mon Sep 17 00:00:00 2001 From: shahzad31 Date: Tue, 29 Oct 2024 18:39:46 +0100 Subject: [PATCH] fix types --- .../routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts | 2 +- .../server/routes/settings/params/delete_param.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts index 2b5de8acfdb0f..ba6426de740d3 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/monitor_cruds/bulk_cruds/delete_monitor_bulk.ts @@ -28,7 +28,7 @@ export const deleteSyntheticsMonitorBulkRoute: SyntheticsRestApiRouteFactory< }), }, }, - handler: async (routeContext) => { + handler: async (routeContext): Promise => { const { request } = routeContext; const { ids: idsToDelete } = request.body || {}; diff --git a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/delete_param.ts b/x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/delete_param.ts index 7d9d12ae3b761..9e1ffa3161d23 100644 --- a/x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/delete_param.ts +++ b/x-pack/plugins/observability_solution/synthetics/server/routes/settings/params/delete_param.ts @@ -13,7 +13,7 @@ import { DeleteParamsResponse } from '../../../../common/runtime_types'; export const deleteSyntheticsParamsRoute: SyntheticsRestApiRouteFactory< DeleteParamsResponse[], - unknown, + { id?: string }, unknown, { ids: string[] } > = () => ({ @@ -38,11 +38,11 @@ export const deleteSyntheticsParamsRoute: SyntheticsRestApiRouteFactory< if (ids && paramId) { return response.badRequest({ - body: `Both param id ${queryId} and body parameters cannot be provided`, + body: `Both param id and body parameters cannot be provided`, }); } - const idsToDelete = ids ?? [queryId]; + const idsToDelete = ids ?? [paramId]; if (idsToDelete.length === 0) { return response.badRequest({