remove from legacy folder api

This commit is contained in:
Ryan McKinley
2025-12-02 15:47:47 +03:00
parent 53eead1fa5
commit ba038e2848
3 changed files with 16 additions and 6 deletions
@@ -62,13 +62,18 @@ func convertUnstructuredToFolder(item *unstructured.Unstructured, identifiers ma
}
}
parent := meta.GetFolder()
if folder.IsRootFolder(parent) {
parent = ""
}
manager, _ := meta.GetManagerProperties()
return &folder.Folder{
UID: uid,
Title: title,
Description: description,
ID: meta.GetDeprecatedInternalID(), // nolint:staticcheck
ParentUID: meta.GetFolder(),
ParentUID: parent,
Version: int(meta.GetGeneration()),
ManagedBy: manager.Kind,
+1 -1
View File
@@ -1384,7 +1384,7 @@ func SplitFullpath(s string) []string {
func (s *Service) nestedFolderCreate(ctx context.Context, cmd *folder.CreateFolderCommand) (*folder.Folder, error) {
ctx, span := s.tracer.Start(ctx, "folder.nestedFolderCreate")
defer span.End()
if cmd.ParentUID != "" {
if !folder.IsRootFolder(cmd.ParentUID) {
if err := s.validateParent(ctx, cmd.OrgID, cmd.ParentUID, cmd.UID); err != nil {
return nil, err
}