From 90c7325213bc1047d10e58bc8e49b8b0618c53e4 Mon Sep 17 00:00:00 2001 From: Praveen Thirumurugan Date: Wed, 19 Nov 2025 07:21:21 +0530 Subject: [PATCH] Update route.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- dashboard/app/api/metrics/route.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard/app/api/metrics/route.ts b/dashboard/app/api/metrics/route.ts index d431166..d3b95ef 100644 --- a/dashboard/app/api/metrics/route.ts +++ b/dashboard/app/api/metrics/route.ts @@ -46,11 +46,11 @@ export async function GET(request: NextRequest) { client_ip, stream FROM ${TABLE_NAME} - WHERE timestamp >= NOW() - INTERVAL '${hours} hours' + WHERE timestamp >= NOW() - INTERVAL '$1 hours' ORDER BY timestamp DESC - LIMIT ${limit} + LIMIT $2 `; - const recentResult = await client.query(recentQuery); + const recentResult = await client.query(recentQuery, [hours, limit]); const recentRequests = recentResult.rows; // Get model breakdown