Skip to content

Commit df315bf

Browse files
committed
wip: black
1 parent 347e5dc commit df315bf

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/console/core/script/onboard-zen-black.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ if (amountInCents !== 20000) {
4040
}
4141

4242
const subscriptionData = await Billing.stripe().subscriptions.retrieve(subscription.id, { expand: ["discounts"] })
43-
const couponID = subscriptionData.discounts[0]?.coupon?.id
43+
const couponID =
44+
typeof subscriptionData.discounts[0] === "string"
45+
? subscriptionData.discounts[0]
46+
: subscriptionData.discounts[0]?.coupon?.id
4447

4548
// Check if subscription is already tied to another workspace
4649
const existingSubscription = await Database.use((tx) =>

0 commit comments

Comments
 (0)