feat: harden analytics dashboard
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user