We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 347e5dc commit df315bfCopy full SHA for df315bf
packages/console/core/script/onboard-zen-black.ts
@@ -40,7 +40,10 @@ if (amountInCents !== 20000) {
40
}
41
42
const subscriptionData = await Billing.stripe().subscriptions.retrieve(subscription.id, { expand: ["discounts"] })
43
-const couponID = subscriptionData.discounts[0]?.coupon?.id
+const couponID =
44
+ typeof subscriptionData.discounts[0] === "string"
45
+ ? subscriptionData.discounts[0]
46
+ : subscriptionData.discounts[0]?.coupon?.id
47
48
// Check if subscription is already tied to another workspace
49
const existingSubscription = await Database.use((tx) =>
0 commit comments