feat: harden analytics dashboard

This commit is contained in:
2026-05-27 15:19:31 +08:00
parent 5e0ca6a504
commit 356039d9cf
34 changed files with 1424 additions and 879 deletions

View File

@@ -1,7 +1,13 @@
import { NextResponse } from "next/server";
import { jsonError } from "@/lib/api-params";
import { getDateRange } from "@/lib/queries";
export async function GET() {
const data = await getDateRange();
return NextResponse.json(data);
try {
const data = await getDateRange();
return NextResponse.json(data);
} catch (error) {
console.error("Failed to load date range", error);
return jsonError(undefined, 500);
}
}