diff --git a/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx b/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx index 788a44d316bd3..5477c4fa135ae 100644 --- a/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx +++ b/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx @@ -27,7 +27,7 @@ import { UnsavedQueryEditor, } from 'src/SqlLab/types'; import { - useUpdateCurrentQueryEditorMutation, + useUpdateCurrentSqlEditorTabMutation, useUpdateSqlEditorTabMutation, } from 'src/hooks/apiResources/sqlEditorTabs'; import { useDebounceValue } from 'src/hooks/useDebounceValue'; @@ -83,7 +83,7 @@ const EditorAutoSync: FC = () => { ({ sqlLab }) => sqlLab.lastUpdatedActiveTab, ); const [updateSqlEditor, { error }] = useUpdateSqlEditorTabMutation(); - const [updateCurrentSqlEditor] = useUpdateCurrentQueryEditorMutation(); + const [updateCurrentSqlEditor] = useUpdateCurrentSqlEditorTabMutation(); const debouncedUnsavedQueryEditor = useDebounceValue( unsavedQueryEditor, diff --git a/superset-frontend/src/hooks/apiResources/sqlEditorTabs.test.ts b/superset-frontend/src/hooks/apiResources/sqlEditorTabs.test.ts index 16c337e82738e..e2bb7c41e97fe 100644 --- a/superset-frontend/src/hooks/apiResources/sqlEditorTabs.test.ts +++ b/superset-frontend/src/hooks/apiResources/sqlEditorTabs.test.ts @@ -25,7 +25,7 @@ import { import { api } from 'src/hooks/apiResources/queryApi'; import { LatestQueryEditorVersion } from 'src/SqlLab/types'; import { - useUpdateCurrentQueryEditorMutation, + useUpdateCurrentSqlEditorTabMutation, useUpdateSqlEditorTabMutation, } from './sqlEditorTabs'; @@ -105,7 +105,7 @@ test('posts activate request with queryEditorId', async () => { const tabStateMutationApiRoute = `glob:*/tabstateview/${expectedQueryEditor.id}/activate`; fetchMock.post(tabStateMutationApiRoute, 200); const { result, waitFor } = renderHook( - () => useUpdateCurrentQueryEditorMutation(), + () => useUpdateCurrentSqlEditorTabMutation(), { wrapper: createWrapper({ useRedux: true, diff --git a/superset-frontend/src/hooks/apiResources/sqlEditorTabs.ts b/superset-frontend/src/hooks/apiResources/sqlEditorTabs.ts index 03c4c494a0e8e..29fe102235c62 100644 --- a/superset-frontend/src/hooks/apiResources/sqlEditorTabs.ts +++ b/superset-frontend/src/hooks/apiResources/sqlEditorTabs.ts @@ -66,7 +66,7 @@ const sqlEditorApi = api.injectEndpoints({ ), }), }), - updateCurrentQueryEditor: builder.mutation({ + updateCurrentSqlEditorTab: builder.mutation({ query: queryEditorId => ({ method: 'POST', endpoint: encodeURI(`/tabstateview/${queryEditorId}/activate`), @@ -78,5 +78,5 @@ const sqlEditorApi = api.injectEndpoints({ export const { useUpdateSqlEditorTabMutation, - useUpdateCurrentQueryEditorMutation, + useUpdateCurrentSqlEditorTabMutation, } = sqlEditorApi;