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.

Case-insensitive HubSpot lifecycle stage comparisons (#3791)

Kiran Kbc53f437a236
diff --git a/apps/web/lib/integrations/hubspot/track-lead.ts b/apps/web/lib/integrations/hubspot/track-lead.ts
index 99b14be0ac..d1e3edb391 100644
--- a/apps/web/lib/integrations/hubspot/track-lead.ts
+++ b/apps/web/lib/integrations/hubspot/track-lead.ts
@@ -148,7 +148,8 @@ export const trackHubSpotLeadEvent = async ({
}
if (
- contactInfo.properties.lifecyclestage !== settings.leadLifecycleStageId
+ contactInfo.properties.lifecyclestage?.toLowerCase() !==
+ settings.leadLifecycleStageId?.toLowerCase()
) {
return `Unknown contact lifecyclestage ${contactInfo.properties.lifecyclestage}. Expected ${settings.leadLifecycleStageId}.`;
}
diff --git a/apps/web/lib/integrations/hubspot/track-sale.ts b/apps/web/lib/integrations/hubspot/track-sale.ts
index 3228450568..1046a25c05 100644
--- a/apps/web/lib/integrations/hubspot/track-sale.ts
+++ b/apps/web/lib/integrations/hubspot/track-sale.ts
@@ -28,7 +28,9 @@ export const trackHubSpotSaleEvent = async ({
return `Unknown propertyName ${propertyName}. Expected dealstage.`;
}
- if (propertyValue !== settings.closedWonDealStageId) {
+ if (
+ propertyValue.toLowerCase() !== settings.closedWonDealStageId?.toLowerCase()
+ ) {
return `Unknown propertyValue ${propertyValue}. Expected ${settings.closedWonDealStageId}.`;
}