Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update customer-subscription-updated.ts

Kiran K18c4367927e1
diff --git a/apps/web/app/api/stripe/webhook/customer-subscription-updated.ts b/apps/web/app/api/stripe/webhook/customer-subscription-updated.ts
index b3f64d0e99..58365477b8 100644
--- a/apps/web/app/api/stripe/webhook/customer-subscription-updated.ts
+++ b/apps/web/app/api/stripe/webhook/customer-subscription-updated.ts
@@ -83,6 +83,7 @@ export async function customerSubscriptionUpdated(event: Stripe.Event) {
usersLimit: plan.limits.users!,
salesLimit: plan.limits.sales!,
paymentFailedAt: null,
+ ...(shouldDeleteFolders && { foldersUsage: 0 }),
},
}),
@@ -147,17 +148,6 @@ export async function customerSubscriptionUpdated(event: Stripe.Event) {
},
});
- await prisma.project.update({
- where: {
- id: workspace.id,
- },
- data: {
- foldersUsage: {
- decrement: folders.length,
- },
- },
- });
-
await Promise.all(
folders.map(({ id }) =>
scheduleLinkSync({