Skip to content

Commit cc37008

Browse files
author
Saurabh Kumar Bajpai
committed
fix: resolve 4 bugs in devtrack
1 parent da5762b commit cc37008

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/app/api/metrics/contributions/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ export async function GET(req: NextRequest) {
383383
} else {
384384
const daysParam = req.nextUrl.searchParams.get("days");
385385
const parsedDays = daysParam ? parseInt(daysParam, 10) : NaN;
386-
days = isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays));
386+
days = Number.isNaN(parsedDays) ? 30 : Math.max(1, Math.min(365, parsedDays));
387387
}
388388

389389
const accountId = req.nextUrl.searchParams.get("accountId");

src/app/api/metrics/prs/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ async function getAverageFirstReviewHours(
158158
if (validDurations.length === 0) return null;
159159

160160
const average = validDurations.reduce((sum, value) => sum + value, 0) / validDurations.length;
161-
return Math.round(average * 10) / 10;
161+
return Math.round(average * 10 + Number.EPSILON) / 10;
162162
}
163163

164164
async function fetchPRMetrics(

0 commit comments

Comments
 (0)