Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix(seats): null out subscription ID when no remaining Pro-seat org found

Richie McIlroy7caa88952acb
diff --git a/apps/web/actions/organization/toggle-pro-seat.ts b/apps/web/actions/organization/toggle-pro-seat.ts
index bd60b93d0..5337a6689 100644
--- a/apps/web/actions/organization/toggle-pro-seat.ts
+++ b/apps/web/actions/organization/toggle-pro-seat.ts
@@ -145,6 +145,11 @@ export async function toggleProSeat(
thirdPartyStripeSubscriptionId: remainingOrg.stripeSubscriptionId,
})
.where(eq(users.id, member.userId));
+ } else {
+ await tx
+ .update(users)
+ .set({ thirdPartyStripeSubscriptionId: null })
+ .where(eq(users.id, member.userId));
}
}
}