From 14ab9e7ba913d0b17a52db7b14a6c2e928469a3e Mon Sep 17 00:00:00 2001 From: Jacques Ikot Date: Mon, 23 Jun 2025 10:06:07 +0100 Subject: [PATCH] feat: enable fetching organizations based on cloud billing status (#41016) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Fix failing fetch organizations endpoint when cloud billing is not enabled. ## Automation /ok-to-test tags="@tag.Sanity, @tag.Settings" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 690015bcb5bc09131c68dfa3e7a360b683824e7e > Cypress dashboard. > Tags: `@tag.Sanity, @tag.Settings` > Spec: >
Mon, 23 Jun 2025 09:03:07 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit - **Bug Fixes** - Improved application behavior by only fetching organizations when cloud billing is enabled, preventing unnecessary data loading. --- app/client/src/ce/pages/Applications/index.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/client/src/ce/pages/Applications/index.tsx b/app/client/src/ce/pages/Applications/index.tsx index fd201a609f..b52921360f 100644 --- a/app/client/src/ce/pages/Applications/index.tsx +++ b/app/client/src/ce/pages/Applications/index.tsx @@ -1022,6 +1022,7 @@ export const ApplictionsMainPage = (props: any) => { const organizations = useSelector(getMyOrganizations); const isFetchingOrganizations = useSelector(getIsFetchingMyOrganizations); const currentOrganizationId = useSelector(activeOrganizationId); + const isCloudBillingEnabled = useIsCloudBillingEnabled(); // TODO: Fix this the next time the file is edited // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -1044,8 +1045,10 @@ export const ApplictionsMainPage = (props: any) => { ); useEffect(() => { - dispatch(fetchMyOrganizations()); - }, []); + if (isCloudBillingEnabled) { + dispatch(fetchMyOrganizations()); + } + }, [isCloudBillingEnabled]); useEffect(() => { setActiveWorkspaceId(