mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove Result from dashboard models (#61997)
* Chore: Remove Result from dashboard models * Fix lint tests * Fix dashboard service tests * Fix API tests * Remove commented out code * Chore: Merge main - cleanup
This commit is contained in:
@@ -408,12 +408,12 @@ func (s *Service) legacyUpdate(ctx context.Context, cmd *folder.UpdateFolderComm
|
||||
logger := s.log.FromContext(ctx)
|
||||
|
||||
query := dashboards.GetDashboardQuery{OrgID: cmd.OrgID, UID: cmd.UID}
|
||||
_, err := s.dashboardStore.GetDashboard(ctx, &query)
|
||||
queryResult, err := s.dashboardStore.GetDashboard(ctx, &query)
|
||||
if err != nil {
|
||||
return nil, toFolderError(err)
|
||||
}
|
||||
|
||||
dashFolder := query.Result
|
||||
dashFolder := queryResult
|
||||
currentTitle := dashFolder.Title
|
||||
|
||||
if !dashFolder.IsFolder {
|
||||
|
||||
@@ -126,11 +126,9 @@ func TestIntegrationFolderService(t *testing.T) {
|
||||
|
||||
title := "Folder-TEST"
|
||||
t.Run("When updating folder should return access denied error", func(t *testing.T) {
|
||||
dashStore.On("GetDashboard", mock.Anything, mock.AnythingOfType("*dashboards.GetDashboardQuery")).Run(func(args mock.Arguments) {
|
||||
folder := args.Get(1).(*dashboards.GetDashboardQuery)
|
||||
folder.Result = dashboards.NewDashboard("dashboard-test")
|
||||
folder.Result.IsFolder = true
|
||||
}).Return(&dashboards.Dashboard{}, nil)
|
||||
folderResult := dashboards.NewDashboard("dashboard-test")
|
||||
folderResult.IsFolder = true
|
||||
dashStore.On("GetDashboard", mock.Anything, mock.AnythingOfType("*dashboards.GetDashboardQuery")).Return(folderResult, nil)
|
||||
_, err := service.Update(context.Background(), &folder.UpdateFolderCommand{
|
||||
UID: folderUID,
|
||||
OrgID: orgID,
|
||||
|
||||
Reference in New Issue
Block a user