mirror of
https://github.com/mendableai/firecrawl.git
synced 2025-06-27 00:41:33 +00:00
fix(v1): check credits variable scope collision
This is what’s been causing the weird insufficient credits errors.
This commit is contained in:
parent
7ed19c0ac0
commit
60a4db0080
@ -38,9 +38,10 @@ import { tokenUsageController } from "../controllers/v1/token-usage";
|
|||||||
import { ongoingCrawlsController } from "../controllers/v1/crawl-ongoing";
|
import { ongoingCrawlsController } from "../controllers/v1/crawl-ongoing";
|
||||||
|
|
||||||
function checkCreditsMiddleware(
|
function checkCreditsMiddleware(
|
||||||
minimum?: number,
|
_minimum?: number,
|
||||||
): (req: RequestWithAuth, res: Response, next: NextFunction) => void {
|
): (req: RequestWithAuth, res: Response, next: NextFunction) => void {
|
||||||
return (req, res, next) => {
|
return (req, res, next) => {
|
||||||
|
let minimum = _minimum;
|
||||||
(async () => {
|
(async () => {
|
||||||
if (!minimum && req.body) {
|
if (!minimum && req.body) {
|
||||||
minimum =
|
minimum =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user