From 20384904e72c383ebc82777945e9db3fa3b7a7f4 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Wed, 5 Aug 2026 18:34:37 +0530 Subject: [PATCH] fix: resolve 4 bugs in devtrack --- src/app/api/metrics/contributions/route.ts | 2 +- src/app/api/milestones/route.ts | 2 +- src/app/api/user/orgs/route.ts | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/api/metrics/contributions/route.ts b/src/app/api/metrics/contributions/route.ts index 225440241..6c8140444 100644 --- a/src/app/api/metrics/contributions/route.ts +++ b/src/app/api/metrics/contributions/route.ts @@ -383,7 +383,7 @@ export async function GET(req: NextRequest) { } else { const daysParam = req.nextUrl.searchParams.get("days"); const parsedDays = daysParam ? parseInt(daysParam, 10) : NaN; - days = isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays)); + days = Number.isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays)); } const accountId = req.nextUrl.searchParams.get("accountId"); diff --git a/src/app/api/milestones/route.ts b/src/app/api/milestones/route.ts index 4019a3d7f..19ec9c30c 100644 --- a/src/app/api/milestones/route.ts +++ b/src/app/api/milestones/route.ts @@ -92,7 +92,7 @@ export async function POST(req: Request) { ? unit.trim().slice(0, MAX_UNIT_LEN) : "units"; - if (typeof targetDate !== "string" || isNaN(new Date(targetDate).getTime())) { + if (typeof targetDate !== "string" || Number.isNaN(new Date(targetDate).getTime())) { return NextResponse.json({ error: "targetDate must be a valid date string" }, { status: 400 }); } diff --git a/src/app/api/user/orgs/route.ts b/src/app/api/user/orgs/route.ts index 5bc5302c2..1444d1258 100644 --- a/src/app/api/user/orgs/route.ts +++ b/src/app/api/user/orgs/route.ts @@ -173,3 +173,5 @@ export async function POST(req: NextRequest) { return NextResponse.json({ error: "Internal server error" }, { status: 500 }); } } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file