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.

skip duplicates when creating coupon

Steven Tey48010e681ad4
diff --git a/apps/web/lib/rewardful/import-affiliate-coupons.ts b/apps/web/lib/rewardful/import-affiliate-coupons.ts
index 4c89ac8445..73a6910e1a 100644
--- a/apps/web/lib/rewardful/import-affiliate-coupons.ts
+++ b/apps/web/lib/rewardful/import-affiliate-coupons.ts
@@ -136,6 +136,7 @@ export async function importAffiliateCoupons(payload: RewardfulImportPayload) {
};
})
.filter((code): code is NonNullable<typeof code> => code !== null),
+ skipDuplicates: true,
});
console.log(`Created ${createdDiscountCodes.count} discount codes`);