mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix npm check errors
This commit is contained in:
@@ -9,11 +9,16 @@
|
||||
upgradeURL
|
||||
} from '$lib/stores/billing';
|
||||
import { currentPlan } from '$lib/stores/organization';
|
||||
import { onMount } from 'svelte';
|
||||
import SelectProjectCloud from './selectProjectCloud.svelte';
|
||||
let showSelectProject = $state(false);
|
||||
let showSelectProject: boolean = $state(false);
|
||||
let selectedProjects: string[] = $state([]);
|
||||
onMount(() => {
|
||||
selectedProjects = page.data.organization?.projects || [];
|
||||
});
|
||||
</script>
|
||||
|
||||
<SelectProjectCloud bind:showSelectProject />
|
||||
<SelectProjectCloud bind:showSelectProject bind:selectedProjects />
|
||||
|
||||
{#if $currentPlan && $currentPlan.projects > 0 && !hideBillingHeaderRoutes.includes(page.url.pathname)}
|
||||
<HeaderAlert
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
let {
|
||||
showSelectProject = $bindable(false),
|
||||
selectedProjects = []
|
||||
selectedProjects = $bindable([])
|
||||
}: {
|
||||
showSelectProject: boolean;
|
||||
selectedProjects: string[];
|
||||
|
||||
@@ -297,7 +297,7 @@
|
||||
if (currentOrganizationId === org.$id) return;
|
||||
if (isCloud) {
|
||||
currentOrganizationId = org.$id;
|
||||
checkForProjectsLimit(org, data.projects?.length || 0);
|
||||
checkForProjectsLimit(org, data.projects?.projects?.length || 0);
|
||||
checkForEnterpriseTrial(org);
|
||||
await checkForUsageLimit(org);
|
||||
checkForMarkedForDeletion(org);
|
||||
|
||||
@@ -4,6 +4,7 @@ import type { LayoutLoad } from './$types';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import type { Tier } from '$lib/stores/billing';
|
||||
import type { Plan, PlanList } from '$lib/sdk/billing';
|
||||
import { Query } from '@appwrite.io/console';
|
||||
|
||||
export const load: LayoutLoad = async ({ depends, parent }) => {
|
||||
const { organizations } = await parent();
|
||||
@@ -28,6 +29,20 @@ export const load: LayoutLoad = async ({ depends, parent }) => {
|
||||
preferences.organization ??
|
||||
(organizations.teams.length > 0 ? organizations.teams[0].$id : undefined);
|
||||
|
||||
// Load projects for the current organization if one is selected
|
||||
let projects = null;
|
||||
if (currentOrgId) {
|
||||
try {
|
||||
projects = await sdk.forConsole.projects.list([
|
||||
Query.equal('teamId', currentOrgId),
|
||||
Query.limit(1000) // Get all projects for organization
|
||||
]);
|
||||
} catch (e) {
|
||||
// Handle error silently - projects might not be accessible
|
||||
projects = {};
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
plansInfo,
|
||||
roles: [],
|
||||
@@ -36,7 +51,8 @@ export const load: LayoutLoad = async ({ depends, parent }) => {
|
||||
currentOrgId,
|
||||
organizations,
|
||||
consoleVariables,
|
||||
version: versionData?.version ?? null
|
||||
version: versionData?.version ?? null,
|
||||
projects
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user