update to free if cancelled
This commit is contained in:
@@ -186,7 +186,10 @@ export async function syncStripeData(customerId: string) {
|
|||||||
await db.team.update({
|
await db.team.update({
|
||||||
where: { id: team.id },
|
where: { id: team.id },
|
||||||
data: {
|
data: {
|
||||||
plan: getPlanFromPriceIds(priceIds),
|
plan:
|
||||||
|
subscription.status === "canceled"
|
||||||
|
? "FREE"
|
||||||
|
: getPlanFromPriceIds(priceIds),
|
||||||
isActive: subscription.status === "active",
|
isActive: subscription.status === "active",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user