diff --git a/pkg/services/file.go b/pkg/services/file.go index 5f60906..76d7a15 100644 --- a/pkg/services/file.go +++ b/pkg/services/file.go @@ -263,13 +263,16 @@ func (fs *FileService) ListFiles(c *gin.Context) (*schemas.FileResponse, *types. } else if fileQuery.Op == "search" { - query.Where("teldrive.get_tsquery(?) @@ teldrive.get_tsvector(name)", fileQuery.Search). - Select("*,(select path from teldrive.files as f where f.id = files.parent_id) as parent_path") + query.Where("teldrive.get_tsquery(?) @@ teldrive.get_tsvector(name)", fileQuery.Search) setOrderFilter(query, &pagingParams, &sortingParams) query.Order(getOrder(sortingParams)) } + if fileQuery.Path == "" { + query.Select("*,(select path from teldrive.files as f where f.id = files.parent_id) as parent_path") + } + var results []schemas.FileOut query.Scan(&results) diff --git a/ui/teldrive-ui b/ui/teldrive-ui index 22e2afa..517b807 160000 --- a/ui/teldrive-ui +++ b/ui/teldrive-ui @@ -1 +1 @@ -Subproject commit 22e2afa966c7949e8f808de9254351c209347fc1 +Subproject commit 517b8075217eb9d8ef8e30a4aa8608364850025f