fix: remove ::uuid casts on project_id/p.id in all agent session routes

Made-with: Cursor
This commit is contained in:
2026-03-07 12:44:45 -08:00
parent 8c19dc1802
commit 7f61295637
3 changed files with 6 additions and 6 deletions

View File

@@ -44,7 +44,7 @@ export async function POST(
const rows = await query<{ data: Record<string, unknown> }>( const rows = await query<{ data: Record<string, unknown> }>(
`SELECT p.data FROM fs_projects p `SELECT p.data FROM fs_projects p
JOIN fs_users u ON u.id = p.user_id JOIN fs_users u ON u.id = p.user_id
WHERE p.id = $1::uuid AND u.data->>'email' = $2 LIMIT 1`, WHERE p.id::text = $1 AND u.data->>'email' = $2 LIMIT 1`,
[projectId, session.user.email] [projectId, session.user.email]
); );
if (rows.length === 0) { if (rows.length === 0) {
@@ -59,7 +59,7 @@ export async function POST(
// Find the session to get the appName (so we can find the right Coolify UUID) // Find the session to get the appName (so we can find the right Coolify UUID)
const sessionRows = await query<{ app_name: string; status: string }>( const sessionRows = await query<{ app_name: string; status: string }>(
`SELECT app_name, status FROM agent_sessions WHERE id = $1::uuid AND project_id = $2::uuid LIMIT 1`, `SELECT app_name, status FROM agent_sessions WHERE id = $1::uuid AND project_id::text = $2 LIMIT 1`,
[sessionId, projectId] [sessionId, projectId]
); );
if (sessionRows.length === 0) { if (sessionRows.length === 0) {

View File

@@ -40,9 +40,9 @@ export async function GET(
s.status, s.output, s.changed_files, s.error, s.status, s.output, s.changed_files, s.error,
s.created_at, s.started_at, s.completed_at s.created_at, s.started_at, s.completed_at
FROM agent_sessions s FROM agent_sessions s
JOIN fs_projects p ON p.id = s.project_id JOIN fs_projects p ON p.id::text = s.project_id::text
JOIN fs_users u ON u.id = p.user_id JOIN fs_users u ON u.id = p.user_id
WHERE s.id = $1::uuid AND s.project_id = $2::uuid AND u.data->>'email' = $3 WHERE s.id = $1::uuid AND s.project_id::text = $2 AND u.data->>'email' = $3
LIMIT 1`, LIMIT 1`,
[sessionId, projectId, session.user.email] [sessionId, projectId, session.user.email]
); );

View File

@@ -19,9 +19,9 @@ export async function POST(
// Verify ownership // Verify ownership
const rows = await query<{ status: string }>( const rows = await query<{ status: string }>(
`SELECT s.status FROM agent_sessions s `SELECT s.status FROM agent_sessions s
JOIN fs_projects p ON p.id = s.project_id JOIN fs_projects p ON p.id::text = s.project_id::text
JOIN fs_users u ON u.id = p.user_id JOIN fs_users u ON u.id = p.user_id
WHERE s.id = $1::uuid AND s.project_id = $2::uuid AND u.data->>'email' = $3 LIMIT 1`, WHERE s.id = $1::uuid AND s.project_id::text = $2 AND u.data->>'email' = $3 LIMIT 1`,
[sessionId, projectId, session.user.email] [sessionId, projectId, session.user.email]
); );