update to free if cancelled

This commit is contained in:
KM Koushik
2025-08-25 22:52:02 +10:00
parent 3f9094e95d
commit 373185333c

View File

@@ -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",
},
});