14 lines
570 B
JavaScript
14 lines
570 B
JavaScript
import { restartInvestigation } from "@/lib/storage/server-investigation-persistence.js";
|
|
import { withAuthenticatedApi } from "@/lib/supabase/api-auth.js";
|
|
|
|
async function post(_request, { params }) {
|
|
try {
|
|
const snapshot = await restartInvestigation(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 POST = withAuthenticatedApi(post); |