fix(unified-storage): make full path setting optional on get folders (#104757)

This commit is contained in:
Mustafa Sencer Özcan
2025-05-06 16:20:49 +02:00
committed by GitHub
parent fa93b3b74c
commit dc63f8003c
5 changed files with 223 additions and 233 deletions
@@ -151,9 +151,11 @@ func (s *Service) getFromApiServer(ctx context.Context, q *folder.GetFolderQuery
f.ID = dashFolder.ID
f.Version = dashFolder.Version
f, err = s.setFullpath(ctx, f, q.SignedInUser, false)
if err != nil {
return nil, err
if q.WithFullpath || q.WithFullpathUIDs {
f, err = s.setFullpath(ctx, f, false)
if err != nil {
return nil, err
}
}
return f, err
@@ -512,8 +514,6 @@ func (s *Service) createOnApiServer(ctx context.Context, cmd *folder.CreateFolde
return nil, dashboards.ErrFolderInvalidUID
}
user := cmd.SignedInUser
cmd = &folder.CreateFolderCommand{
// TODO: Today, if a UID isn't specified, the dashboard store
// generates a new UID. The new folder store will need to do this as
@@ -531,11 +531,6 @@ func (s *Service) createOnApiServer(ctx context.Context, cmd *folder.CreateFolde
return nil, err
}
f, err = s.setFullpath(ctx, f, user, false)
if err != nil {
return nil, err
}
return f, nil
}