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, `
|
rows, err := db.QueryContext(ctx, `
|
||||||
SELECT id, org_id::text, user_id::text, name, path, type, size, last_modified, created_at
|
SELECT id, org_id::text, user_id::text, name, path, type, size, last_modified, created_at
|
||||||
FROM files
|
FROM files
|
||||||
WHERE user_id = $1 AND path != $2 AND path LIKE $2 || '/%'
|
WHERE user_id = $1 AND path LIKE $2 || '%'
|
||||||
AND ($4 = '' OR name ILIKE '%' || $4 || '%')
|
AND ($3 = '' OR name ILIKE '%' || $3 || '%')
|
||||||
ORDER BY name
|
ORDER BY name
|
||||||
LIMIT $5 OFFSET $6
|
LIMIT $4 OFFSET $5
|
||||||
`, userID, path, path, q, pageSize, offset)
|
`, userID, path, q, pageSize, offset)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user