From 821c62c5750d66e5df895603bb3df874393e2380 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 13 Oct 2024 22:30:11 -0300 Subject: [PATCH] Update credit_billing.ts --- apps/api/src/services/billing/credit_billing.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;