Fix GetUserFiles SQL parameter order
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user