Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
Update credit_billing.ts
Nicolas7689c31d3584
diff --git a/apps/api/src/services/billing/credit_billing.ts b/apps/api/src/services/billing/credit_billing.tsindex a5060261c..37db664ed 100644--- a/apps/api/src/services/billing/credit_billing.ts+++ b/apps/api/src/services/billing/credit_billing.ts@@ -40,8 +40,10 @@ export async function supaBillTeam(team_id: string, credits: number) {let sortedCoupons = coupons.sort((a, b) => b.credits - a.credits);// using coupon credits:if (couponCredits > 0) {+ // if there is no subscription and they have enough coupon creditsif (!subscription) {// using only coupon credits:+ // if there are enough coupon creditsif (couponCredits >= credits) {// remove credits from coupon creditslet usedCredits = credits;