23 lines
634 B
TypeScript
23 lines
634 B
TypeScript
import { schemaDiff } from "@/lib/atlas";
|
|
import { getPipeline } from "@/lib/db";
|
|
|
|
export const runtime = "nodejs";
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export async function GET(
|
|
_request: Request,
|
|
{ params }: { params: Promise<{ id: string }> }
|
|
) {
|
|
try {
|
|
const { id } = await params;
|
|
const pipeline = getPipeline(Number(id));
|
|
if (!pipeline) {
|
|
return Response.json({ error: "pipeline not found" }, { status: 404 });
|
|
}
|
|
const result = await schemaDiff(pipeline);
|
|
return Response.json(result);
|
|
} catch (err) {
|
|
return Response.json({ error: (err as Error).message }, { status: 500 });
|
|
}
|
|
}
|