mirror of
https://github.com/tgdrive/teldrive.git
synced 2024-11-10 17:14:03 +08:00
fixed list
This commit is contained in:
parent
451b162cf3
commit
e6b2a796f9
1 changed files with 2 additions and 2 deletions
|
@ -165,7 +165,8 @@ func (fs *FileService) ListFiles(c *gin.Context) (*schemas.FileResponse, *types.
|
|||
return nil, &types.AppError{Error: errors.New(""), Code: http.StatusBadRequest}
|
||||
}
|
||||
|
||||
query := fs.Db.Model(&models.File{}).Limit(pagingParams.PerPage)
|
||||
query := fs.Db.Model(&models.File{}).Limit(pagingParams.PerPage).
|
||||
Where(map[string]interface{}{"user_id": userId, "status": "active"})
|
||||
|
||||
if fileQuery.Op == "list" {
|
||||
|
||||
|
@ -176,7 +177,6 @@ func (fs *FileService) ListFiles(c *gin.Context) (*schemas.FileResponse, *types.
|
|||
setOrderFilter(query, &pagingParams, &sortingParams)
|
||||
|
||||
query.Order("type DESC").Order(getOrder(sortingParams)).
|
||||
Where(map[string]interface{}{"user_id": userId, "status": "active"}).
|
||||
Where("parent_id in (?)", fs.Db.Model(&models.File{}).Select("id").Where("path = ?", fileQuery.Path))
|
||||
|
||||
} else if fileQuery.Op == "find" {
|
||||
|
|
Loading…
Reference in a new issue