mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-02 06:20:29 +00:00
wip: black
This commit is contained in:
parent
dd5ec26c8c
commit
c4eacd0ccf
1 changed files with 4 additions and 1 deletions
|
|
@ -40,7 +40,10 @@ if (amountInCents !== 20000) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const subscriptionData = await Billing.stripe().subscriptions.retrieve(subscription.id, { expand: ["discounts"] })
|
const subscriptionData = await Billing.stripe().subscriptions.retrieve(subscription.id, { expand: ["discounts"] })
|
||||||
const couponID = subscriptionData.discounts[0]?.coupon?.id
|
const couponID =
|
||||||
|
typeof subscriptionData.discounts[0] === "string"
|
||||||
|
? subscriptionData.discounts[0]
|
||||||
|
: subscriptionData.discounts[0]?.coupon?.id
|
||||||
|
|
||||||
// Check if subscription is already tied to another workspace
|
// Check if subscription is already tied to another workspace
|
||||||
const existingSubscription = await Database.use((tx) =>
|
const existingSubscription = await Database.use((tx) =>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue