import { NextResponse } from "next/server"; import { readTable } from "@/lib/wiki"; export async function GET(_req: Request, ctx: { params: Promise<{ tableId: string }> }) { const { tableId } = await ctx.params; const { md, csv } = await readTable(tableId); if (!md) return NextResponse.json({ error: "not_found" }, { status: 404 }); return NextResponse.json({ table_id: tableId, frontmatter: md.fm, body: md.body, csv, }); }