Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/api/metrics/languages/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function GET(req: NextRequest) {
const data = await withMetricsCache({ bypass, key, ttlSeconds: METRICS_CACHE_TTL_SECONDS.languages }, async () => {
const headers = { Authorization: `Bearer ${token}`, Accept: "application/vnd.github+json" };
const since = new Date();
const rawDays = parseInt(req.nextUrl.searchParams.get("days") ?? "90", 10); const days = Number.isFinite(rawDays) && rawDays > 0 ? Math.min(rawDays, 365) : 90;
const rawDays = parseInt(req.nextUrl.searchParams.get("days", 10) ?? "90", 10); const days = Number.isFinite(rawDays) && rawDays > 0 ? Math.min(rawDays, 365) : 90;

const searchRes = await fetch(
`${GITHUB_API}/search/commits?q=author:${githubLogin}+author-date:>=${since.toISOString().slice(0, 10)}&per_page=100&sort=author-date&order=desc`,
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/metrics/repo-health/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export async function GET(req: NextRequest) {
return Response.json({ error: "Unauthorized" }, { status: 401 });
}

const requestedDays = parseInt(req.nextUrl.searchParams.get("days") ?? "30", 10);
const requestedDays = parseInt(req.nextUrl.searchParams.get("days", 10) ?? "30", 10);
// Only allow 7, 30, or 90 day windows — other values default to 30.
const days = requestedDays === 7 || requestedDays === 30 || requestedDays === 90 ? requestedDays : 30;

Expand Down
3 changes: 2 additions & 1 deletion src/app/api/project-tutor/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,5 @@
console.error("Project tutor error:", error);
return NextResponse.json({ error: "Something went wrong" }, { status: 500 });
}
}
}
.catch(err => console.error("Promise.all failed:", err));

Check failure on line 167 in src/app/api/project-tutor/route.ts

View workflow job for this annotation

GitHub Actions / Type check

';' expected.

Check failure on line 167 in src/app/api/project-tutor/route.ts

View workflow job for this annotation

GitHub Actions / Type check

')' expected.

Check failure on line 167 in src/app/api/project-tutor/route.ts

View workflow job for this annotation

GitHub Actions / Type check

'try' expected.

Check failure on line 167 in src/app/api/project-tutor/route.ts

View workflow job for this annotation

GitHub Actions / Type check

Declaration or statement expected.
Loading