fix: Complete schema adaptation for all tool modules

- auth.ts: Use suspendedAt instead of isSuspended, role instead of isAdmin
- comments.ts: Use role='admin' for admin user queries
- documents.ts: Use suspendedAt IS NULL for active users
- events.ts: Return actorRole instead of actorIsAdmin
- shares.ts: Use role='admin' for admin user queries

All queries validated against Outline v0.78 schema (10/10 tests pass).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-31 13:34:53 +00:00
parent 6f5d17516b
commit 7116722d73
5 changed files with 10 additions and 10 deletions

View File

@@ -252,7 +252,7 @@ const createComment: BaseTool<CreateCommentArgs> = {
// Note: In real implementation, createdById should come from authentication context
// For now, we'll get the first admin user
const userQuery = await pgClient.query(
'SELECT id FROM users WHERE "isAdmin" = true AND "deletedAt" IS NULL LIMIT 1'
`SELECT id FROM users WHERE role = 'admin' AND "deletedAt" IS NULL LIMIT 1`
);
if (userQuery.rows.length === 0) {
@@ -427,7 +427,7 @@ const resolveComment: BaseTool<GetCommentArgs> = {
// Get first admin user as resolver
const userQuery = await pgClient.query(
'SELECT id FROM users WHERE "isAdmin" = true AND "deletedAt" IS NULL LIMIT 1'
`SELECT id FROM users WHERE role = 'admin' AND "deletedAt" IS NULL LIMIT 1`
);
if (userQuery.rows.length === 0) {