From 467f40abd3b2a928ac070b8e0285fdf73ba2e9bd Mon Sep 17 00:00:00 2001
From: Arman
Date: Mon, 29 Jul 2024 14:53:55 +0200
Subject: [PATCH] feat: add aggregations
---
.../change-plan/+page.svelte | 12 ++----------
.../organization-[organization]/change-plan/+page.ts | 11 ++++++++---
2 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/src/routes/console/organization-[organization]/change-plan/+page.svelte b/src/routes/console/organization-[organization]/change-plan/+page.svelte
index ea2a6b9a5..eb9a222ba 100644
--- a/src/routes/console/organization-[organization]/change-plan/+page.svelte
+++ b/src/routes/console/organization-[organization]/change-plan/+page.svelte
@@ -62,6 +62,8 @@
if (m.userEmail !== $user.email) return m.userEmail;
})
?.filter(Boolean) ?? [];
+ let totalExtraMembers = data?.aggregationList;
+ $: console.log(totalExtraMembers);
let couponData: Partial = {
code: null,
status: null,
@@ -264,16 +266,6 @@
For more details on our plans, visit our
.
- {#if anyOrgFree && billingPlan !== BillingPlan.FREE}
-
- You are limited to one {tierToPlan(BillingPlan.FREE).name} organization per account.
- Consider upgrading or deleting .
-
- {/if}
{
- const { members } = await parent();
- depends(Dependencies.ORGANIZATION);
+ const { members, organization } = await parent();
+ depends(Dependencies.ORGANIZATION);
return {
- members
+ members,
+ aggregationList: await sdk.forConsole.billing.listAggregation(organization?.$id, [
+ Query.orderDesc('$createdAt')
+ ])
};
};