Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ export async function GET(
_request: NextRequest,
{ params }: { params: Promise<{ docId: string; sectionId: string }> },
) {
const { docId, sectionId } = await params;
const { ok, status, data } = await forwardToCP(
`/v1/documents/${docId}/sections/${sectionId}`,
);
// The engine exposes sections at the flat /v1/sections/{id} path (scoped
// by the org header), not nested under the document. docId is only part
// of the dashboard URL/breadcrumb.
const { sectionId } = await params;
const { ok, status, data } = await forwardToCP(`/v1/sections/${sectionId}`);
if (!ok) {
return NextResponse.json(data ?? { error: "Upstream error" }, { status });
}
Expand Down
Loading