diff --git a/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx b/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx index 2f4b55a42a..6b030714d1 100644 --- a/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx +++ b/app/client/src/pages/Editor/IntegrationEditor/CreateNewDatasourceTab.tsx @@ -89,6 +89,7 @@ function CreateNewAPI({ active, history, isCreating, + isOnboardingScreen, pageId, showUnsupportedPluginDialog, }: any) { @@ -114,6 +115,7 @@ function CreateNewAPI({ void; + isOnboardingScreen?: boolean; } type Props = ApiHomeScreenProps; @@ -154,7 +155,14 @@ export const API_ACTION = { }; function NewApiScreen(props: Props) { - const { history, isCreating, pageId, plugins, showSaasAPIs } = props; + const { + history, + isCreating, + isOnboardingScreen, + pageId, + plugins, + showSaasAPIs, + } = props; const editorType = useEditorType(location.pathname); const { editorId, parentEntityId, parentEntityType } = useParentEntityInfo(editorType); @@ -190,7 +198,8 @@ function NewApiScreen(props: Props) { props.createNewApiActionBasedOnEditorType( editorType, editorId, - parentEntityId, + // Set parentEntityId as (parentEntityId or if it is onboarding screen then set it as pageId) else empty string + parentEntityId || (isOnboardingScreen && pageId) || "", parentEntityType, source === API_ACTION.CREATE_NEW_GRAPHQL_API ? PluginPackageName.GRAPHQL