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.

Default percentage to 0 if undefined in reward amount (#3363)

Marcus Farrellb733901707a0
diff --git a/apps/web/lib/api/sales/construct-reward-amount.ts b/apps/web/lib/api/sales/construct-reward-amount.ts
index 1d89f9592e..b0f6840bba 100644
--- a/apps/web/lib/api/sales/construct-reward-amount.ts
+++ b/apps/web/lib/api/sales/construct-reward-amount.ts
@@ -72,7 +72,7 @@ export const constructRewardAmount = (
// 1. There are no modifiers OR
// 2. type AND timelines doesn't match the primary reward
return reward.type === "percentage"
- ? `${reward.amountInPercentage}%`
+ ? `${reward.amountInPercentage ?? 0}%`
: currencyFormatter(reward.amountInCents ?? 0, {
trailingZeroDisplay: "stripIfInteger",
});