mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-21 17:54:23 +01:00
wip: zen
This commit is contained in:
@@ -409,6 +409,7 @@ export async function handler(
|
|||||||
tx
|
tx
|
||||||
.select({
|
.select({
|
||||||
balance: BillingTable.balance,
|
balance: BillingTable.balance,
|
||||||
|
paymentMethodID: BillingTable.paymentMethodID,
|
||||||
monthlyLimit: BillingTable.monthlyLimit,
|
monthlyLimit: BillingTable.monthlyLimit,
|
||||||
monthlyUsage: BillingTable.monthlyUsage,
|
monthlyUsage: BillingTable.monthlyUsage,
|
||||||
timeMonthlyUsageUpdated: BillingTable.timeMonthlyUsageUpdated,
|
timeMonthlyUsageUpdated: BillingTable.timeMonthlyUsageUpdated,
|
||||||
@@ -418,6 +419,7 @@ export async function handler(
|
|||||||
.then((rows) => rows[0]),
|
.then((rows) => rows[0]),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (!billing.paymentMethodID) throw new CreditsError("No payment method")
|
||||||
if (billing.balance <= 0) throw new CreditsError("Insufficient balance")
|
if (billing.balance <= 0) throw new CreditsError("Insufficient balance")
|
||||||
if (
|
if (
|
||||||
billing.monthlyLimit &&
|
billing.monthlyLimit &&
|
||||||
|
|||||||
Reference in New Issue
Block a user