CI / typecheck + build (turbo) (push) Canceled after 0s
- Migrate document fetching and CRUD to be PostgreSQL-authoritative - Remove static section enums and add dynamic listSections query - Support custom sections and metadata across API, MCP, and Web UI - Add /api/sections endpoint and update Header, Sidebar, and Forms - Remove obsolete phase planning docs and modernize README/AGENTS
16 lines
506 B
TypeScript
16 lines
506 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { listSections } from "@mcpedia/core";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
// GET /api/sections — list all active sections with document counts dynamically from PostgreSQL.
|
|
export async function GET() {
|
|
try {
|
|
const sections = await listSections();
|
|
return NextResponse.json(sections);
|
|
} catch (err) {
|
|
const msg = err instanceof Error ? err.message : String(err);
|
|
return NextResponse.json({ error: msg }, { status: 500 });
|
|
}
|
|
}
|