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.

account for undefined values

Steven Teyf8c22d07f32d
diff --git a/apps/web/lib/partnerstack/import-commissions.ts b/apps/web/lib/partnerstack/import-commissions.ts
index 6c65432238..05a1f4cfae 100644
--- a/apps/web/lib/partnerstack/import-commissions.ts
+++ b/apps/web/lib/partnerstack/import-commissions.ts
@@ -70,7 +70,10 @@ export async function importCommissions(payload: PartnerStackImportPayload) {
email: {
in: commissions
.map((commission) => commission.customer?.email)
- .filter((email): email is string => email !== null),
+ .filter(
+ (email): email is string =>
+ email !== null && email !== undefined,
+ ),
},
},
{
@@ -78,7 +81,8 @@ export async function importCommissions(payload: PartnerStackImportPayload) {
in: commissions
.map((commission) => commission.customer?.external_key)
.filter(
- (externalKey): externalKey is string => externalKey !== null,
+ (externalKey): externalKey is string =>
+ externalKey !== null && externalKey !== undefined,
),
},
},