mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-05 18:20:42 +08:00
fix(credit_billing): return chunk.remaining_credits
This commit is contained in:
parent
2073063fb7
commit
c1f68c3e0a
@ -191,7 +191,7 @@ export async function supaCheckTeamCredits(chunk: AuthCreditUsageChunk, team_id:
|
||||
chunk.sub_current_period_start,
|
||||
chunk.sub_current_period_end
|
||||
);
|
||||
return { success: false, message: "Insufficient credits, please upgrade!", remainingCredits: chunk.price_credits - chunk.adjusted_credits_used, chunk };
|
||||
return { success: false, message: "Insufficient credits, please upgrade!", remainingCredits: chunk.remaining_credits, chunk };
|
||||
} else if (creditUsagePercentage >= 0.8 && creditUsagePercentage < 1) {
|
||||
// Send email notification for approaching credit limit
|
||||
sendNotification(
|
||||
@ -202,7 +202,7 @@ export async function supaCheckTeamCredits(chunk: AuthCreditUsageChunk, team_id:
|
||||
);
|
||||
}
|
||||
|
||||
return { success: true, message: "Sufficient credits available", remainingCredits: chunk.price_credits - chunk.adjusted_credits_used, chunk };
|
||||
return { success: true, message: "Sufficient credits available", remainingCredits: chunk.remaining_credits, chunk };
|
||||
}
|
||||
|
||||
// Count the total credits used by a team within the current billing period and return the remaining credits.
|
||||
|
Loading…
x
Reference in New Issue
Block a user