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.

Update create-discount.ts

Kiran Kaff528e7f7e5
diff --git a/apps/web/lib/actions/partners/create-discount.ts b/apps/web/lib/actions/partners/create-discount.ts
index d7856d446f..b1c70325c7 100644
--- a/apps/web/lib/actions/partners/create-discount.ts
+++ b/apps/web/lib/actions/partners/create-discount.ts
@@ -59,13 +59,11 @@ export const createDiscountAction = authActionClient
couponId = stripeCoupon.id;
}
} catch (error) {
- if (error.code === "more_permissions_required_for_application") {
- throw new Error(
- "STRIPE_APP_UPGRADE_REQUIRED: Your connected Stripe account doesn't have the permissions needed to create discount codes. Please upgrade your Stripe app permissions in the dashboard or reach out to our support team for help.",
- );
- }
-
- throw new Error(error.message);
+ throw new Error(
+ error.code === "more_permissions_required_for_application"
+ ? "STRIPE_APP_UPGRADE_REQUIRED: Your connected Stripe account doesn't have the permissions needed to create discount codes. Please upgrade your Stripe app permissions in the dashboard or reach out to our support team for help."
+ : error.message,
+ );
}
}