Nested Folders: Fix /api/folders pagination (#79447)
* Nested Folders: Fix /api/folders pagination We used to check access to the root folders after fetching them from the DB with pagination. This fix splits logic for fetching folders in: - fetching subfolders - fetching root folders and refactors the query for the latter so that is filters by folders with permissions * Add tests * Update benchmarks
This commit is contained in:
committed by
GitHub
parent
cf8e8852c3
commit
d89a8a3a82
@@ -160,8 +160,8 @@ type GetParentsQuery struct {
|
||||
// return a list of child folders of the given folder.
|
||||
|
||||
type GetChildrenQuery struct {
|
||||
UID string `xorm:"uid"`
|
||||
OrgID int64 `xorm:"org_id"`
|
||||
UID string
|
||||
OrgID int64
|
||||
Depth int64
|
||||
|
||||
// Pagination options
|
||||
@@ -169,6 +169,9 @@ type GetChildrenQuery struct {
|
||||
Page int64
|
||||
|
||||
SignedInUser identity.Requester `json:"-"`
|
||||
|
||||
// array of folder uids to filter by
|
||||
FolderUIDs []string `json:"-"`
|
||||
}
|
||||
|
||||
type HasEditPermissionInFoldersQuery struct {
|
||||
|
||||
Reference in New Issue
Block a user