NestedFolders: Add API endpoint for descendant count in a folder (#66550)

* Add CountInFolder to RegistryService interface
* Add folder children counts api route
* Update fake GetFolderChildrenCounts
* Add test for getting folder children counts
* Add validation to folder children counts handler
* Update openapi specs
* Update pkg/services/folder/folderimpl/folder.go
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

---------

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
Arati R
2023-04-24 15:57:28 +02:00
committed by GitHub
co-authored by Sofia Papagiannaki
parent 990b3c07ab
commit fd434cab58
14 changed files with 821 additions and 36 deletions
+11
View File
@@ -160,3 +160,14 @@ type HasEditPermissionInFoldersQuery struct {
type HasAdminPermissionInDashboardsOrFoldersQuery struct {
SignedInUser *user.SignedInUser
}
// GetChildrenCountsQuery captures the information required by the folder service
// to return the count of children in a folder.
type GetChildrenCountsQuery struct {
UID *string
OrgID int64
SignedInUser *user.SignedInUser `json:"-"`
}
type ChildrenCounts map[string]int64