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 @@
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;

Check failure on line 59 in src/app/api/metrics/languages/route.ts

View workflow job for this annotation

GitHub Actions / Type check

Expected 1 arguments, but got 2.

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 @@
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);

Check failure on line 153 in src/app/api/metrics/repo-health/route.ts

View workflow job for this annotation

GitHub Actions / Type check

Expected 1 arguments, but got 2.
// 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
Loading