Update credit_billing.ts
This commit is contained in:
parent
5683bb2cc8
commit
5991000d2b
@ -208,7 +208,6 @@ 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) {
|
||||
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user