From ad079b80b8fb7bee0b9c02d89653b93824e599a1 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Wed, 5 Aug 2026 18:18:34 +0530 Subject: [PATCH] fix: resolve 4 bugs in devtrack --- src/app/api/metrics/productive-hours/route.ts | 2 +- src/app/api/milestones/route.ts | 2 +- src/app/compare/[users]/page.tsx | 2 ++ src/app/u/[username]/page.tsx | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/api/metrics/productive-hours/route.ts b/src/app/api/metrics/productive-hours/route.ts index 5bb62d383..839a900c4 100644 --- a/src/app/api/metrics/productive-hours/route.ts +++ b/src/app/api/metrics/productive-hours/route.ts @@ -223,7 +223,7 @@ export async function GET(req: NextRequest) { } else { const daysParam = searchParams.get("days"); const parsedDays = daysParam ? parseInt(daysParam, 10) : NaN; - days = isNaN(parsedDays) ? 90 : Math.max(1, Math.min(365, parsedDays)); + days = Number.isNaN(parsedDays) ? 90 : Math.max(1, Math.min(365, parsedDays)); } const accountId = 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/compare/[users]/page.tsx b/src/app/compare/[users]/page.tsx index fa4e35efe..280156d54 100644 --- a/src/app/compare/[users]/page.tsx +++ b/src/app/compare/[users]/page.tsx @@ -419,3 +419,5 @@ function ReposCard({ username, repos }: { username: string; repos: TopRepo[] }) ); } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/src/app/u/[username]/page.tsx b/src/app/u/[username]/page.tsx index e2f2dd718..247669961 100644 --- a/src/app/u/[username]/page.tsx +++ b/src/app/u/[username]/page.tsx @@ -710,3 +710,5 @@ function PublicTopRepos({ ); } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file