diff --git a/src/app/api/local-coding/stats/route.ts b/src/app/api/local-coding/stats/route.ts index 37e03bd45..687736c4a 100644 --- a/src/app/api/local-coding/stats/route.ts +++ b/src/app/api/local-coding/stats/route.ts @@ -26,7 +26,7 @@ export async function GET(req: NextRequest) { if (!user) return Response.json({ error: "User not found" }, { status: 404 }); const { searchParams } = new URL(req.url); - const rawDays = parseInt(searchParams.get("days") || "30", 10); + const rawDays = parseInt(searchParams.get("days", 10) || "30", 10); const days = validateDays(isNaN(rawDays) ? DEFAULT_DAYS : rawDays); const fromDate = new Date(); fromDate.setDate(fromDate.getDate() - days); 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/metrics/repo-analytics/route.ts b/src/app/api/metrics/repo-analytics/route.ts index caf5e0946..a7a3fb6c4 100644 --- a/src/app/api/metrics/repo-analytics/route.ts +++ b/src/app/api/metrics/repo-analytics/route.ts @@ -98,7 +98,7 @@ export async function GET(req: NextRequest) { } else if (activityRes.ok) { const activityData = await activityRes.json(); if (Array.isArray(activityData) && activityData.length > 0) { - const lastWeek = activityData[activityData.length - 1]; + const lastWeek = activityData.at(-1); const days: number[] = lastWeek.days || []; // `lastWeek.week` is a Unix timestamp (seconds) for the Sunday that starts the bucket. // Derive labels from it so they always match the actual calendar days GitHub recorded. diff --git a/src/app/u/[username]/opengraph-image.tsx b/src/app/u/[username]/opengraph-image.tsx index 06afb7a0e..3f76f82ee 100644 --- a/src/app/u/[username]/opengraph-image.tsx +++ b/src/app/u/[username]/opengraph-image.tsx @@ -219,3 +219,5 @@ export default async function Image({ ); } } + +.catch(err => console.error("Promise.all failed:", err)); \ No newline at end of file