Skip to content

Commit 7b4ce5a

Browse files
committed
fix: include page_number in getBySection query
The section endpoint was missing page_number from the SELECT, causing the spec explorer to show "Page —" and default to page 1.
1 parent 3309658 commit 7b4ce5a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

apps/mcp-server/src/db.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export interface SpecContent {
2222
title: string | null;
2323
content: string;
2424
contentType: string;
25+
pageNumber: number | null;
2526
}
2627

2728
export function createDb(connectionString: string) {
@@ -99,15 +100,15 @@ export function createDb(connectionString: string) {
99100

100101
if (partNumber !== undefined) {
101102
results = await sql`
102-
SELECT id, part_number, section_id, title, content, content_type
103+
SELECT id, part_number, section_id, title, content, content_type, page_number
103104
FROM spec_content
104105
WHERE section_id LIKE ${pattern}
105106
AND part_number = ${partNumber}
106107
ORDER BY section_id, id
107108
`;
108109
} else {
109110
results = await sql`
110-
SELECT id, part_number, section_id, title, content, content_type
111+
SELECT id, part_number, section_id, title, content, content_type, page_number
111112
FROM spec_content
112113
WHERE section_id LIKE ${pattern}
113114
ORDER BY section_id, id
@@ -121,6 +122,7 @@ export function createDb(connectionString: string) {
121122
title: r.title as string | null,
122123
content: r.content as string,
123124
contentType: r.content_type as string,
125+
pageNumber: r.page_number as number | null,
124126
}));
125127
},
126128

0 commit comments

Comments
 (0)