From 4d125e801c440584dcfc5a6e5ffc09f697e307b5 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Bajpai Date: Thu, 6 Aug 2026 17:44:17 +0530 Subject: [PATCH] fix: resolve 4 bugs in devtrack --- src/app/api/ai-insights/route.ts | 2 ++ src/app/api/goals/route.ts | 2 +- src/app/api/milestones/route.ts | 2 +- src/app/compare/[users]/page.tsx | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/app/api/ai-insights/route.ts b/src/app/api/ai-insights/route.ts index 29bad31b4..a10e3be62 100644 --- a/src/app/api/ai-insights/route.ts +++ b/src/app/api/ai-insights/route.ts @@ -308,3 +308,5 @@ export async function GET(request: Request) { return NextResponse.json({ data: payload, cached: false }); } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file diff --git a/src/app/api/goals/route.ts b/src/app/api/goals/route.ts index 0d616ebd3..644a3a364 100644 --- a/src/app/api/goals/route.ts +++ b/src/app/api/goals/route.ts @@ -308,7 +308,7 @@ try { unit: goal.unit, recurrence: goal.recurrence, category: goal.category, - }).catch(() => {}); + }).catch( => console.error()); return Response.json({ goal }, { status: 201 }); } 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