diff --git a/app/client/src/components/editorComponents/actioncreator/ActionCreator.tsx b/app/client/src/components/editorComponents/actioncreator/ActionCreator.tsx index 8bb1ff3ce3..743e06863c 100644 --- a/app/client/src/components/editorComponents/actioncreator/ActionCreator.tsx +++ b/app/client/src/components/editorComponents/actioncreator/ActionCreator.tsx @@ -14,10 +14,9 @@ import { ControlWrapper } from "components/propertyControls/StyledControls"; import { KeyValueComponent } from "components/propertyControls/KeyValueComponent"; import { InputText } from "components/propertyControls/InputTextControl"; import { createModalAction } from "actions/widgetActions"; -import { createActionRequest } from "actions/actionActions"; -import { DEFAULT_API_ACTION } from "constants/ApiEditorConstants"; import { createNewApiName } from "utils/AppsmithUtils"; import { isDynamicValue } from "utils/DynamicBindingUtils"; +import { createNewApiAction } from "actions/apiPaneActions"; const ALERT_STYLE_OPTIONS = [ { label: "Info", value: "'info'", id: "info" }, @@ -667,13 +666,7 @@ function useApiOptionTree() { value: `${apiName}.run`, type: ActionType.api, }); - dispatch( - createActionRequest({ - ...DEFAULT_API_ACTION, - name: apiName, - pageId: pageId, - }), - ); + dispatch(createNewApiAction(pageId)); } }, }); diff --git a/app/client/src/pages/Editor/APIEditor/ApiHomeScreen.tsx b/app/client/src/pages/Editor/APIEditor/ApiHomeScreen.tsx index bab1786280..75cf57e69f 100644 --- a/app/client/src/pages/Editor/APIEditor/ApiHomeScreen.tsx +++ b/app/client/src/pages/Editor/APIEditor/ApiHomeScreen.tsx @@ -24,7 +24,6 @@ import { getProvidersLoadingState, } from "selectors/applicationSelectors"; import { getProviderCategories } from "selectors/editorSelectors"; -import { createActionRequest } from "actions/actionActions"; import { fetchImportedCollections } from "actions/collectionAction"; import { API_HOME_SCREEN_FORM } from "constants/forms"; import { @@ -306,7 +305,6 @@ type ApiHomeScreenProps = { plugins: Plugin[]; applicationId: string; actions: ActionDataState; - createAction: (data: Partial) => void; fetchProvidersWithCategory: ( request: FetchProviderWithCategoryRequest, ) => void; @@ -782,8 +780,6 @@ const mapDispatchToProps = (dispatch: any) => ({ fetchProviderCategories: () => dispatch(fetchProviderCategories()), fetchProvidersWithCategory: (request: FetchProviderWithCategoryRequest) => dispatch(fetchProvidersWithCategory(request)), - createAction: (data: Partial) => - dispatch(createActionRequest(data)), searchApiOrProvider: (searchKey: string) => dispatch(searchApiOrProvider({ searchKey })), createNewApiAction: (pageId: string) => dispatch(createNewApiAction(pageId)), diff --git a/app/client/src/pages/Editor/APIEditor/index.tsx b/app/client/src/pages/Editor/APIEditor/index.tsx index 270dc2abb2..10d4e99f58 100644 --- a/app/client/src/pages/Editor/APIEditor/index.tsx +++ b/app/client/src/pages/Editor/APIEditor/index.tsx @@ -5,7 +5,6 @@ import ApiEditorForm from "./Form"; import RapidApiEditorForm from "./RapidApiEditorForm"; import ApiHomeScreen from "./ApiHomeScreen"; import { - createActionRequest, runApiAction, deleteAction, updateAction, @@ -49,7 +48,6 @@ interface ReduxStateProps { } interface ReduxActionProps { submitForm: (name: string) => void; - createAction: (values: RestAction) => void; runAction: (id: string, paginationField?: PaginationField) => void; deleteAction: (id: string, name: string) => void; updateAction: (data: RestAction) => void; @@ -246,7 +244,6 @@ const mapStateToProps = (state: AppState, props: any): ReduxStateProps => { const mapDispatchToProps = (dispatch: any): ReduxActionProps => ({ submitForm: (name: string) => dispatch(submit(name)), - createAction: (action: RestAction) => dispatch(createActionRequest(action)), runAction: (id: string, paginationField?: PaginationField) => dispatch(runApiAction(id, paginationField)), deleteAction: (id: string, name: string) => diff --git a/app/client/src/pages/Editor/ApiSidebar.tsx b/app/client/src/pages/Editor/ApiSidebar.tsx index 8fd258352a..d97c0c0fba 100644 --- a/app/client/src/pages/Editor/ApiSidebar.tsx +++ b/app/client/src/pages/Editor/ApiSidebar.tsx @@ -7,7 +7,6 @@ import { ActionDataState } from "reducers/entityReducers/actionsReducer"; import { APIEditorRouteParams } from "constants/routes"; import { ApiPaneReduxState } from "reducers/uiReducers/apiPaneReducer"; import { - createActionRequest, moveActionRequest, copyActionRequest, deleteAction, @@ -66,7 +65,6 @@ interface ReduxStateProps { } interface ReduxDispatchProps { - createAction: (data: Partial) => void; onApiChange: (id: string) => void; initApiPane: (urlId?: string) => void; moveAction: ( @@ -213,8 +211,6 @@ const mapStateToProps = (state: AppState): ReduxStateProps => ({ }); const mapDispatchToProps = (dispatch: Function): ReduxDispatchProps => ({ - createAction: (data: Partial) => - dispatch(createActionRequest(data)), onApiChange: (actionId: string) => dispatch(changeApi(actionId)), initApiPane: (urlId?: string) => dispatch(initApiPane(urlId)), moveAction: (