fix: send memberid on checkout

This commit is contained in:
Rotimi Best
2026-05-27 20:44:56 +01:00
parent 607377f191
commit 730bcee553
5 changed files with 118 additions and 5 deletions
@@ -32,7 +32,7 @@
});
async function handleClick(plan, planName: string) {
if (plan.CTA.IS_DISABLED || !$profile.id || !$profile.email) {
if (plan.CTA.IS_DISABLED || !$profile.id || !$profile.email || !$currentOrg.memberId) {
return;
}
@@ -52,7 +52,7 @@
checkoutURL.searchParams.set(
'metadata',
JSON.stringify({
triggeredBy: $currentOrg.roleId,
triggeredBy: $currentOrg.memberId,
orgId: $currentOrg.id,
orgSlug: $currentOrg.siteName
})
@@ -48,6 +48,7 @@ export const currentOrg: Writable<AccountOrg> = writable({
parentOrganizationId: null,
plans: [],
readOnlyUntil: null,
memberId: 0,
roleId: 0,
settings: {},
siteName: '',