Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(v1): check credits variable scope collision (#1703)

Gergő Móriczfe9057559b6e
diff --git a/apps/api/src/routes/v1.ts b/apps/api/src/routes/v1.ts
index 61f1d539d..cfb98cbe7 100644
--- a/apps/api/src/routes/v1.ts
+++ b/apps/api/src/routes/v1.ts
@@ -38,9 +38,10 @@ import { tokenUsageController } from "../controllers/v1/token-usage";
import { ongoingCrawlsController } from "../controllers/v1/crawl-ongoing";
function checkCreditsMiddleware(
- minimum?: number,
+ _minimum?: number,
): (req: RequestWithAuth, res: Response, next: NextFunction) => void {
return (req, res, next) => {
+ let minimum = _minimum;
(async () => {
if (!minimum && req.body) {
minimum =