mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
address comment.
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user