From 5991000d2b87d28cba88e14461707c3810b7d8b1 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Wed, 5 Jun 2024 13:21:15 -0700 Subject: [PATCH] Update credit_billing.ts --- apps/api/src/services/billing/credit_billing.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/api/src/services/billing/credit_billing.ts b/apps/api/src/services/billing/credit_billing.ts index cfc6bd1..3312df2 100644 --- a/apps/api/src/services/billing/credit_billing.ts +++ b/apps/api/src/services/billing/credit_billing.ts @@ -208,9 +208,8 @@ export async function supaCheckTeamCredits(team_id: string, credits: number) { // check if usage is within 80% of the limit const creditLimit = FREE_CREDITS; const creditUsagePercentage = (totalCreditsUsed + credits) / creditLimit; - console.log("creditUsagePercentage", creditUsagePercentage); - + if (creditUsagePercentage >= 0.8) { await sendNotification(team_id, NotificationType.APPROACHING_LIMIT, new Date().toISOString(), end.toISOString()); } @@ -267,7 +266,6 @@ export async function supaCheckTeamCredits(team_id: string, credits: number) { const creditLimit = price.credits; const creditUsagePercentage = (adjustedCreditsUsed + credits) / creditLimit; - console.log("creditUsagePercentage", creditUsagePercentage); // Compare the adjusted total credits used with the credits allowed by the plan if (adjustedCreditsUsed + credits > price.credits) { await sendNotification(team_id, NotificationType.LIMIT_REACHED, subscription.current_period_start, subscription.current_period_end);