From 3850b000f06baf5302a2a16a4b99448c0c48f90b Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 27 Aug 2024 11:14:04 -0300 Subject: [PATCH] Nick: removing credit notification for now --- .../src/services/billing/credit_billing.ts | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/apps/api/src/services/billing/credit_billing.ts b/apps/api/src/services/billing/credit_billing.ts index 2ad07318..19c17b48 100644 --- a/apps/api/src/services/billing/credit_billing.ts +++ b/apps/api/src/services/billing/credit_billing.ts @@ -317,21 +317,21 @@ export async function supaCheckTeamCredits(team_id: string, credits: number) { // 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 - ); + // await sendNotification( + // team_id, + // NotificationType.LIMIT_REACHED, + // subscription.current_period_start, + // subscription.current_period_end + // ); return { success: false, message: "Insufficient credits, please upgrade!", remainingCredits: creditLimit - adjustedCreditsUsed }; } else if (creditUsagePercentage >= 0.8) { // Send email notification for approaching credit limit - await sendNotification( - team_id, - NotificationType.APPROACHING_LIMIT, - subscription.current_period_start, - subscription.current_period_end - ); + // await sendNotification( + // team_id, + // NotificationType.APPROACHING_LIMIT, + // subscription.current_period_start, + // subscription.current_period_end + // ); } return { success: true, message: "Sufficient credits available", remainingCredits: creditLimit - adjustedCreditsUsed };