fix: Add default sort value to create_collection
Collections without sort field cause frontend error:
"Cannot read properties of null (reading 'field')"
Now sets {"field": "index", "direction": "asc"} as default.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -68,7 +68,7 @@ async function main() {
|
||||
JSON.stringify({
|
||||
status: 'ok',
|
||||
transport: 'streamable-http',
|
||||
version: '1.3.7',
|
||||
version: '1.3.8',
|
||||
sessions: sessions.size,
|
||||
stateful: STATEFUL,
|
||||
tools: allTools.length
|
||||
@@ -101,7 +101,7 @@ async function main() {
|
||||
// Create MCP server
|
||||
const server = createMcpServer(pgClient.getPool(), {
|
||||
name: 'mcp-outline-http',
|
||||
version: '1.3.7'
|
||||
version: '1.3.8'
|
||||
});
|
||||
|
||||
// Track session if stateful
|
||||
|
||||
@@ -39,7 +39,7 @@ async function main() {
|
||||
// Create MCP server with shared configuration
|
||||
const server = createMcpServer(pgClient.getPool(), {
|
||||
name: 'mcp-outline-postgresql',
|
||||
version: '1.3.7'
|
||||
version: '1.3.8'
|
||||
});
|
||||
|
||||
// Connect stdio transport
|
||||
|
||||
@@ -122,7 +122,7 @@ export function createMcpServer(
|
||||
): Server {
|
||||
const server = new Server({
|
||||
name: config.name || 'mcp-outline-postgresql',
|
||||
version: config.version || '1.3.7'
|
||||
version: config.version || '1.3.8'
|
||||
});
|
||||
|
||||
// Set capabilities (required for MCP v2.2+)
|
||||
|
||||
@@ -272,12 +272,12 @@ export const collectionsTools: BaseTool<any>[] = [
|
||||
const query = `
|
||||
INSERT INTO collections (
|
||||
id, name, "urlId", "teamId", "createdById", description, icon, color,
|
||||
permission, sharing, "maintainerApprovalRequired", index, "createdAt", "updatedAt"
|
||||
permission, sharing, "maintainerApprovalRequired", index, sort, "createdAt", "updatedAt"
|
||||
)
|
||||
VALUES (gen_random_uuid(), $1, $2, $3, $4, $5, $6, $7, $8, $9, false, $10, NOW(), NOW())
|
||||
VALUES (gen_random_uuid(), $1, $2, $3, $4, $5, $6, $7, $8, $9, false, $10, '{"field": "index", "direction": "asc"}', NOW(), NOW())
|
||||
RETURNING
|
||||
id, "urlId", name, description, icon, color, index, permission,
|
||||
sharing, "teamId", "createdById", "createdAt", "updatedAt"
|
||||
sharing, "teamId", "createdById", "createdAt", "updatedAt", sort
|
||||
`;
|
||||
|
||||
const result = await pool.query(query, [
|
||||
|
||||
Reference in New Issue
Block a user