Update credit_billing.ts

This commit is contained in:
Nicolas 2024-10-13 22:30:11 -03:00
parent 78b6127d88
commit 821c62c575

View File

@ -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;