From 373185333cb3dfa30b788bfd3608a988cd6480f1 Mon Sep 17 00:00:00 2001 From: KM Koushik Date: Mon, 25 Aug 2025 22:52:02 +1000 Subject: [PATCH] update to free if cancelled --- apps/web/src/server/billing/payments.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/web/src/server/billing/payments.ts b/apps/web/src/server/billing/payments.ts index aa56446..a442627 100644 --- a/apps/web/src/server/billing/payments.ts +++ b/apps/web/src/server/billing/payments.ts @@ -186,7 +186,10 @@ export async function syncStripeData(customerId: string) { await db.team.update({ where: { id: team.id }, data: { - plan: getPlanFromPriceIds(priceIds), + plan: + subscription.status === "canceled" + ? "FREE" + : getPlanFromPriceIds(priceIds), isActive: subscription.status === "active", }, });