Nested Folders: More API fixes (#59316)
* Nested Folder: Fix create, use camel case for JSON properties * Fix get parents if the folder does not exist * Add store test for get parents
This commit is contained in:
@@ -3,6 +3,7 @@ package folderimpl
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/grafana/grafana/pkg/bus"
|
||||
@@ -517,7 +518,7 @@ func (s *Service) nestedFolderCreate(ctx context.Context, cmd *folder.CreateFold
|
||||
func (s *Service) validateParent(ctx context.Context, orgID int64, parentUID string) error {
|
||||
ancestors, err := s.store.GetParents(ctx, folder.GetParentsQuery{UID: parentUID, OrgID: orgID})
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("failed to get parents: %w", err)
|
||||
}
|
||||
|
||||
if len(ancestors) == folder.MaxNestedFolderDepth {
|
||||
|
||||
Reference in New Issue
Block a user