Skip to content

Commit b40dc74

Browse files
committed
chore: record more info in billing feedback
1 parent 0531bd8 commit b40dc74

File tree

1 file changed

+8
-1
lines changed
  • src/routes/(console)/organization-[organization]/change-plan

1 file changed

+8
-1
lines changed

src/routes/(console)/organization-[organization]/change-plan/+page.svelte

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import { onMount } from 'svelte';
3434
import { loadAvailableRegions } from '$routes/(console)/regions';
3535
import EstimatedTotalBox from '$lib/components/billing/estimatedTotalBox.svelte';
36-
36+
import { Query } from '@appwrite.io/console';
3737
export let data;
3838
3939
let selectedCoupon: Partial<Coupon> = null;
@@ -114,6 +114,10 @@
114114
null
115115
);
116116
117+
const paidInvoices = await sdk.forConsole.billing.listInvoices(data.organization.$id, [
118+
Query.equal('status', 'succeeded')
119+
]);
120+
117121
await fetch(`${VARS.GROWTH_ENDPOINT}/feedback/billing`, {
118122
method: 'POST',
119123
headers: {
@@ -128,6 +132,9 @@
128132
)?.label,
129133
orgId: data.organization.$id,
130134
userId: data.account.$id,
135+
orgAge: data.organization.$createdAt,
136+
userAge: data.account.$createdAt,
137+
paidInvoices: paidInvoices.total,
131138
message: feedbackMessage ?? ''
132139
})
133140
});

0 commit comments

Comments
 (0)