diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/convert_connector_api_logic.test.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/convert_connector_api_logic.test.ts index d677ce282ef3d..01691488470f1 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/convert_connector_api_logic.test.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/convert_connector_api_logic.test.ts @@ -19,12 +19,12 @@ describe('ConvertConnectorApilogic', () => { describe('convertConnector', () => { it('calls correct api', async () => { const promise = Promise.resolve('result'); - http.post.mockReturnValue(promise); + http.put.mockReturnValue(promise); const result = convertConnector({ connectorId: 'connectorId1' }); await nextTick(); - expect(http.post).toHaveBeenCalledWith( + expect(http.put).toHaveBeenCalledWith( '/internal/enterprise_search/connectors/connectorId1/native', - { body: JSON.stringify({ is_native: true }) } + { body: JSON.stringify({ is_native: false }) } ); await expect(result).resolves.toEqual('result'); }); diff --git a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/convert_connector_api_logic.ts b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/convert_connector_api_logic.ts index 320a68b0ad9aa..ba998c9dbce9d 100644 --- a/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/convert_connector_api_logic.ts +++ b/x-pack/plugins/enterprise_search/public/applications/enterprise_search_content/api/connector/convert_connector_api_logic.ts @@ -21,10 +21,9 @@ export const convertConnector = async ({ }: ConvertConnectorApiLogicArgs): Promise => { const route = `/internal/enterprise_search/connectors/${connectorId}/native`; - const result = await HttpLogic.values.http.put<{ updated: boolean }>(route, { + return await HttpLogic.values.http.put<{ updated: boolean }>(route, { body: JSON.stringify({ is_native: false }), }); - return result; }; export const ConvertConnectorApiLogic = createApiLogic(