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 bulk-delete-links.ts

Kiran Kd214f2f35cea
diff --git a/apps/web/lib/api/links/bulk-delete-links.ts b/apps/web/lib/api/links/bulk-delete-links.ts
index 5bba04e53c..8157e9e457 100644
--- a/apps/web/lib/api/links/bulk-delete-links.ts
+++ b/apps/web/lib/api/links/bulk-delete-links.ts
@@ -45,13 +45,15 @@ export async function bulkDeleteLinks({
},
}),
- ...links
- .filter((link) => link.couponCode)
- .map((link) =>
- disableStripePromotionCode({
- couponCode: link.couponCode,
- stripeConnectId: workspace.stripeConnectId,
- }),
- ),
+ workspace.stripeConnectId
+ ? links
+ .filter((link) => link.couponCode)
+ .map((link) =>
+ disableStripePromotionCode({
+ couponCode: link.couponCode,
+ stripeConnectId: workspace.stripeConnectId,
+ }),
+ )
+ : [],
]);
}