@@ -2,7 +2,7 @@ import { sdk } from '$lib/stores/sdk.js';
22import { redirect , error } from '@sveltejs/kit' ;
33import { base } from '$app/paths' ;
44import { isCloud } from '$lib/system' ;
5- import { ID , type Models } from '@appwrite.io/console' ;
5+ import { ID , type Models , Query } from '@appwrite.io/console' ;
66import type { OrganizationList } from '$lib/stores/organization' ;
77import { redirectTo } from '$routes/store' ;
88import type { PageLoad } from './$types' ;
@@ -83,7 +83,9 @@ export const load: PageLoad = async ({ parent, url }) => {
8383 let organizations : Models . TeamList < Record < string , unknown > > | OrganizationList | undefined ;
8484
8585 if ( isCloud ) {
86- organizations = await sdk . forConsole . billing . listOrganization ( ) ;
86+ organizations = await sdk . forConsole . billing . listOrganization ( [
87+ Query . equal ( 'platform' , resolvedProfile . organizationPlatform )
88+ ] ) ;
8789 } else {
8890 organizations = await sdk . forConsole . teams . list ( ) ;
8991 }
@@ -107,7 +109,9 @@ export const load: PageLoad = async ({ parent, url }) => {
107109
108110 // Refetch organizations after creation
109111 if ( isCloud ) {
110- organizations = await sdk . forConsole . billing . listOrganization ( ) ;
112+ organizations = await sdk . forConsole . billing . listOrganization ( [
113+ Query . equal ( 'platform' , resolvedProfile . organizationPlatform )
114+ ] ) ;
111115 } else {
112116 organizations = await sdk . forConsole . teams . list ( ) ;
113117 }
0 commit comments