Skip to content

Commit

Permalink
rename update action
Browse files Browse the repository at this point in the history
  • Loading branch information
justinpark committed Jun 6, 2024
1 parent 6a4fef2 commit 3f3accb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -83,7 +83,7 @@ const EditorAutoSync: FC = () => {
({ sqlLab }) => sqlLab.lastUpdatedActiveTab,
);
const [updateSqlEditor, { error }] = useUpdateSqlEditorTabMutation();
const [updateCurrentSqlEditor] = useUpdateCurrentQueryEditorMutation();
const [updateCurrentSqlEditor] = useUpdateCurrentSqlEditorTabMutation();

const debouncedUnsavedQueryEditor = useDebounceValue(
unsavedQueryEditor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
import { api } from 'src/hooks/apiResources/queryApi';
import { LatestQueryEditorVersion } from 'src/SqlLab/types';
import {
useUpdateCurrentQueryEditorMutation,
useUpdateCurrentSqlEditorTabMutation,
useUpdateSqlEditorTabMutation,
} from './sqlEditorTabs';

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions superset-frontend/src/hooks/apiResources/sqlEditorTabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const sqlEditorApi = api.injectEndpoints({
),
}),
}),
updateCurrentQueryEditor: builder.mutation<string, string>({
updateCurrentSqlEditorTab: builder.mutation<string, string>({
query: queryEditorId => ({
method: 'POST',
endpoint: encodeURI(`/tabstateview/${queryEditorId}/activate`),
Expand All @@ -78,5 +78,5 @@ const sqlEditorApi = api.injectEndpoints({

export const {
useUpdateSqlEditorTabMutation,
useUpdateCurrentQueryEditorMutation,
useUpdateCurrentSqlEditorTabMutation,
} = sqlEditorApi;

0 comments on commit 3f3accb

Please sign in to comment.