mirror of
https://github.com/vernu/textbee.git
synced 2026-03-03 02:27:00 +00:00
chore(api): handle missing discountId
This commit is contained in:
@@ -306,11 +306,14 @@ export class BillingService {
|
||||
}
|
||||
|
||||
try {
|
||||
const discount = await this.polarApi.discounts.get({
|
||||
id: discountId,
|
||||
})
|
||||
if (discount) {
|
||||
checkoutOptions.discountId = discount.id
|
||||
let discount = null;
|
||||
if (discountId) {
|
||||
discount = await this.polarApi.discounts.get({
|
||||
id: discountId,
|
||||
})
|
||||
if (discount) {
|
||||
checkoutOptions.discountId = discount.id
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('failed to get discount', error)
|
||||
|
||||
Reference in New Issue
Block a user