14 lines
561 B
JavaScript
14 lines
561 B
JavaScript
import { loadInvestigation } from "@/lib/storage/server-investigation-persistence.js";
|
|
import { withAuthenticatedApi } from "@/lib/supabase/api-auth.js";
|
|
|
|
async function get(_request, { params }) {
|
|
try {
|
|
const snapshot = await loadInvestigation(params.id);
|
|
if (!snapshot) return Response.json({ error: "Investigation not found" }, { status: 404 });
|
|
return Response.json({ snapshot });
|
|
} catch {
|
|
return Response.json({ error: "Investigation persistence request failed" }, { status: 500 });
|
|
}
|
|
}
|
|
|
|
export const GET = withAuthenticatedApi(get); |