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.

delete the logo when customer.subscription.deleted occur

Kiran K394f64e2a642
diff --git a/apps/web/app/api/stripe/webhook/customer-subscription-deleted.ts b/apps/web/app/api/stripe/webhook/customer-subscription-deleted.ts
index 3081b70243..5bd7355bf4 100644
--- a/apps/web/app/api/stripe/webhook/customer-subscription-deleted.ts
+++ b/apps/web/app/api/stripe/webhook/customer-subscription-deleted.ts
@@ -111,6 +111,16 @@ export async function customerSubscriptionDeleted(event: Stripe.Event) {
},
}),
+ // remove logo from all domains for the workspace
+ prisma.domain.updateMany({
+ where: {
+ projectId: workspace.id,
+ },
+ data: {
+ logo: null,
+ },
+ }),
+
// remove root domain link for all domains from MySQL
prisma.link.updateMany({
where: {