diff --git a/src/app/api/local-coding/stats/route.ts b/src/app/api/local-coding/stats/route.ts index c1e5cd4e..be722998 100644 --- a/src/app/api/local-coding/stats/route.ts +++ b/src/app/api/local-coding/stats/route.ts @@ -40,12 +40,11 @@ export async function GET(req: NextRequest) { .order("date", { ascending: false }); if (error) { - // Table may not exist in all deployments — degrade gracefully - return Response.json({ - dailyData: [], - totals: { totalSeconds: 0, totalDays: 0, avgSecondsPerDay: 0 }, - hasData: false, - }); + console.error("Failed to fetch local coding stats:", error); + return Response.json( + { error: "Failed to fetch local coding stats" }, + { status: 500 } + ); } if (!sessions || sessions.length === 0) {