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

@@ -260,7 +260,7 @@ const createShare: BaseTool<CreateShareArgs> = {
// Get first admin user as creator
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) {
@@ -416,7 +416,7 @@ const revokeShare: BaseTool<GetShareArgs> = {
// Get first admin user as revoker
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) {