Skip to content

Commit

Permalink
refactor: add path for find op
Browse files Browse the repository at this point in the history
  • Loading branch information
divyam234 committed Jul 14, 2024
1 parent c49b78b commit 826b672
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/services/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ func (fs *FileService) ListFiles(userId int64, fquery *schemas.FileQuery) (*sche
if fquery.ParentID != "" {
query.Where("parent_id = ?", fquery.ParentID)
}
if fquery.ParentID == "" && fquery.Path != "" && fquery.Query == "" {
query.Where("parent_id in (SELECT id FROM teldrive.get_file_from_path(?, ?))", fquery.Path, userId)
}
if fquery.Type != "" {
query.Where("type = ?", fquery.Type)
}
Expand Down

0 comments on commit 826b672

Please sign in to comment.