diff --git a/src/lib/commandCenter/searchers/organizations.ts b/src/lib/commandCenter/searchers/organizations.ts index c7e202bbb7..c24f38799e 100644 --- a/src/lib/commandCenter/searchers/organizations.ts +++ b/src/lib/commandCenter/searchers/organizations.ts @@ -3,12 +3,14 @@ import { base } from '$app/paths'; import { sdk } from '$lib/stores/sdk'; import type { Searcher } from '../commands'; import { isCloud } from '$lib/system'; -import { Query } from '@appwrite.io/console'; +import { Platform, Query } from '@appwrite.io/console'; export const orgSearcher = (async (query: string) => { const { teams } = !isCloud ? await sdk.forConsole.teams.list() - : await sdk.forConsole.billing.listOrganization([Query.equal('platform', 'appwrite')]); + : await sdk.forConsole.billing.listOrganization([ + Query.equal('platform', Platform.Appwrite) + ]); return teams .filter((organization) => organization.name.toLowerCase().includes(query.toLowerCase())) diff --git a/src/routes/(console)/account/organizations/+page.ts b/src/routes/(console)/account/organizations/+page.ts index c498951d75..c669a9fe1f 100644 --- a/src/routes/(console)/account/organizations/+page.ts +++ b/src/routes/(console)/account/organizations/+page.ts @@ -14,7 +14,7 @@ export const load: PageLoad = async ({ url, route }) => { Query.offset(offset), Query.limit(limit), Query.orderDesc(''), - Query.equal('platform', Platform.Appwrite) + ...(isCloud ? [Query.equal('platform', Platform.Appwrite)] : []) ]; const organizations = !isCloud diff --git a/src/routes/(console)/organization-[organization]/+layout.ts b/src/routes/(console)/organization-[organization]/+layout.ts index 38cf095370..ef77274e81 100644 --- a/src/routes/(console)/organization-[organization]/+layout.ts +++ b/src/routes/(console)/organization-[organization]/+layout.ts @@ -113,6 +113,8 @@ async function checkPlatformAndRedirect( } } + if (!isCloud) return requestedOrg; + if (requestedOrg && requestedOrg.platform !== Platform.Appwrite) { const orgIdInPrefs = prefs.organization; diff --git a/src/routes/(console)/project-[region]-[project]/+layout.ts b/src/routes/(console)/project-[region]-[project]/+layout.ts index 56748c9df6..e45017ad88 100644 --- a/src/routes/(console)/project-[region]-[project]/+layout.ts +++ b/src/routes/(console)/project-[region]-[project]/+layout.ts @@ -42,7 +42,7 @@ export const load: LayoutLoad = async ({ params, depends, parent }) => { // not the right organization project based on platform, // redirect to organization, and it should handle the rest! - if (organization.platform !== Platform.Appwrite) { + if (isCloud && organization.platform !== Platform.Appwrite) { redirect( 303, resolve('/(console)/organization-[organization]', {