diff --git a/apps/api/src/services/billing/credit_billing.ts b/apps/api/src/services/billing/credit_billing.ts index 39e9f15e..694d0e5c 100644 --- a/apps/api/src/services/billing/credit_billing.ts +++ b/apps/api/src/services/billing/credit_billing.ts @@ -55,7 +55,7 @@ export async function supaCheckTeamCredits(chunk: AuthCreditUsageChunk, team_id: const creditsWillBeUsed = chunk.adjusted_credits_used + credits; - // In case chunk.price_credits is undefined, set it to a large number to avoid division by zero + // In case chunk.price_credits is undefined, set it to a large number to avoid mistakes const totalPriceCredits = chunk.price_credits ?? 100000000; // Removal of + credits const creditUsagePercentage = creditsWillBeUsed / totalPriceCredits;