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.

address coderabbit feedback

Steven Tey23e535ecdfd1
diff --git a/apps/web/lib/rewardful/import-affiliate-coupons.ts b/apps/web/lib/rewardful/import-affiliate-coupons.ts
index 662b04d57b..8cf2a42b21 100644
--- a/apps/web/lib/rewardful/import-affiliate-coupons.ts
+++ b/apps/web/lib/rewardful/import-affiliate-coupons.ts
@@ -36,13 +36,19 @@ export async function importAffiliateCoupons(payload: RewardfulImportPayload) {
page: currentPage,
});
+ if (allAffiliateCoupons.length === 0) {
+ hasMore = false;
+ break;
+ }
+
const activeAffiliateCoupons = allAffiliateCoupons.filter(
(affiliateCoupon) => !affiliateCoupon.archived,
);
if (activeAffiliateCoupons.length === 0) {
- hasMore = false;
- break;
+ currentPage++;
+ processedBatches++;
+ continue;
}
const affiliateIds = activeAffiliateCoupons.map(