mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: account organizations pagination
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
{#if index >= data.offset && index < CARD_LIMIT + data.offset}
|
||||
<GridItem1 href={`${base}/console/organization-${organization.$id}`}>
|
||||
<svelte:fragment slot="eyebrow">
|
||||
{organization?.total ? organization?.total : 'No'} projects
|
||||
{organization?.total ? organization?.total : 'No'} members
|
||||
</svelte:fragment>
|
||||
<svelte:fragment slot="title">
|
||||
{organization.name}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
import { Query } from '@aw-labs/appwrite-console';
|
||||
import { sdkForConsole } from '$lib/stores/sdk';
|
||||
import { pageToOffset } from '$lib/helpers/load';
|
||||
import { PAGE_LIMIT } from '$lib/constants';
|
||||
import { CARD_LIMIT } from '$lib/constants';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load: PageLoad = async ({ params }) => {
|
||||
const page = Number(params.page);
|
||||
const offset = pageToOffset(page, PAGE_LIMIT);
|
||||
const offset = pageToOffset(page, CARD_LIMIT);
|
||||
|
||||
return {
|
||||
offset,
|
||||
organizations: await sdkForConsole.teams.list([
|
||||
Query.offset(offset),
|
||||
Query.limit(PAGE_LIMIT)
|
||||
Query.limit(CARD_LIMIT)
|
||||
])
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user