From 586ad28e69dfc6f8bca3abc32978bfca9a210549 Mon Sep 17 00:00:00 2001 From: Darshan Date: Wed, 18 Jun 2025 11:13:08 +0530 Subject: [PATCH] address comment. --- src/routes/(console)/+layout.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/routes/(console)/+layout.ts b/src/routes/(console)/+layout.ts index 95bc32a88..6c46118c8 100644 --- a/src/routes/(console)/+layout.ts +++ b/src/routes/(console)/+layout.ts @@ -6,34 +6,22 @@ import type { Tier } from '$lib/stores/billing'; import type { Plan, PlanList } from '$lib/sdk/billing'; export const load: LayoutLoad = async ({ depends, parent }) => { - let { organizations } = await parent(); + const { organizations } = await parent(); depends(Dependencies.RUNTIMES); depends(Dependencies.CONSOLE_VARIABLES); depends(Dependencies.ORGANIZATION); const { endpoint, project } = sdk.forConsole.client.config; - const [preferences, plansArray, orgs, versionData, consoleVariables] = await Promise.all([ + const [preferences, plansArray, versionData, consoleVariables] = await Promise.all([ sdk.forConsole.account.getPrefs(), isCloud ? sdk.forConsole.billing.getPlansInfo() : null, - // reuse from parent if available, else load fresh. - // know that the parent loads these orgs conditionally! - !organizations - ? isCloud - ? sdk.forConsole.billing.listOrganization() - : sdk.forConsole.teams.list() - : organizations, - fetch(`${endpoint}/health/version`, { headers: { 'X-Appwrite-Project': project } }).then((response) => response.json() as { version?: string }), sdk.forConsole.console.variables() ]); - if (!organizations) { - organizations = orgs; - } - const plansInfo = toPlanMap(plansArray); const currentOrgId =