From 6866f7fdab38cf1f5a61037def35218a0ece9b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6sche?= Date: Fri, 9 Jan 2026 20:31:05 +0100 Subject: [PATCH] Fix GetUserFiles SQL parameter order --- go_cloud/internal/database/db.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/go_cloud/internal/database/db.go b/go_cloud/internal/database/db.go index fcc5ae4..bea52c2 100644 --- a/go_cloud/internal/database/db.go +++ b/go_cloud/internal/database/db.go @@ -312,11 +312,11 @@ func (db *DB) GetUserFiles(ctx context.Context, userID uuid.UUID, path string, q rows, err := db.QueryContext(ctx, ` SELECT id, org_id::text, user_id::text, name, path, type, size, last_modified, created_at FROM files - WHERE user_id = $1 AND path != $2 AND path LIKE $2 || '/%' - AND ($4 = '' OR name ILIKE '%' || $4 || '%') + WHERE user_id = $1 AND path LIKE $2 || '%' + AND ($3 = '' OR name ILIKE '%' || $3 || '%') ORDER BY name - LIMIT $5 OFFSET $6 - `, userID, path, path, q, pageSize, offset) + LIMIT $4 OFFSET $5 + `, userID, path, q, pageSize, offset) if err != nil { return nil, err }