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 ban-partner.ts

Kiran Kfeb38cffd0d6
diff --git a/apps/web/lib/actions/partners/ban-partner.ts b/apps/web/lib/actions/partners/ban-partner.ts
index 976c8c699a..14b268f9dc 100644
--- a/apps/web/lib/actions/partners/ban-partner.ts
+++ b/apps/web/lib/actions/partners/ban-partner.ts
@@ -5,6 +5,7 @@ import { linkCache } from "@/lib/api/links/cache";
import { syncTotalCommissions } from "@/lib/api/partners/sync-total-commissions";
import { getDefaultProgramIdOrThrow } from "@/lib/api/programs/get-default-program-id-or-throw";
import { getProgramEnrollmentOrThrow } from "@/lib/api/programs/get-program-enrollment-or-throw";
+import { disableStripePromotionCode } from "@/lib/stripe/disable-stripe-promotion-code";
import {
BAN_PARTNER_REASONS,
banPartnerSchema,
@@ -105,6 +106,7 @@ export const banPartnerAction = authActionClient
select: {
domain: true,
key: true,
+ couponCode: true,
},
});
@@ -143,6 +145,13 @@ export const banPartnerAction = authActionClient
},
],
}),
+
+ ...links.map((link) =>
+ disableStripePromotionCode({
+ workspace,
+ promotionCode: link.couponCode,
+ }),
+ ),
]);
})(),
);