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.

add guard

Pedro Ladeiraec439b926823
diff --git a/apps/web/lib/rewardful/import-affiliate-coupons.ts b/apps/web/lib/rewardful/import-affiliate-coupons.ts
index cd8751d23f..5fc1ce587c 100644
--- a/apps/web/lib/rewardful/import-affiliate-coupons.ts
+++ b/apps/web/lib/rewardful/import-affiliate-coupons.ts
@@ -129,6 +129,13 @@ export async function importAffiliateCoupons(payload: RewardfulImportPayload) {
return null;
}
+ if (link.partnerId !== partnerId) {
+ console.error(
+ `Skipping coupon ${coupon.token}: link ${link.id} is owned by ${link.partnerId}, expected ${partnerId}`,
+ );
+ return null;
+ }
+
return {
id: createId({ prefix: "dcode_" }),
code: coupon.token,