mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
get projects from page data
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import { page } from '$app/stores';
|
||||
|
||||
export let showSelectProject: boolean;
|
||||
export let selectedProjects: Array<string> = [];
|
||||
@@ -15,14 +16,7 @@
|
||||
let error: string | null = null;
|
||||
|
||||
onMount(() => {
|
||||
sdk.forConsole.projects
|
||||
.list()
|
||||
.then((response) => {
|
||||
projects = response.projects || [];
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Failed to fetch projects:', error);
|
||||
});
|
||||
projects = $page.data.projects?.projects || [];
|
||||
});
|
||||
|
||||
let projectsToArchive: Array<Models.Project> = [];
|
||||
|
||||
@@ -291,7 +291,7 @@ export function checkForProjectsLimit(org: Organization, projects: number) {
|
||||
if (plan.$id !== BillingPlan.FREE) return;
|
||||
if (org.projects.length > 0) return;
|
||||
|
||||
if (projects >= plan.projects) {
|
||||
if (projects > plan.projects) {
|
||||
headerAlert.add({
|
||||
id: 'projectsLimitReached',
|
||||
component: ProjectsLimit,
|
||||
|
||||
Reference in New Issue
Block a user