Skip to content

Commit

Permalink
Code Review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
safaci2000 committed Mar 11, 2024
1 parent 1516da8 commit 0bba334
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/tools/org_preferences.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func newUpdateOrgPreferenceCmd() simplecobra.Commander {

err = rootCmd.GrafanaSvc().UploadOrgPreferences(org, prefere)
if err != nil {
log.Fatal("Failed to update org preferences")
log.Fatalf("Failed to update org preferences, %v", err)
}
slog.Info("Preferences update for organization", slog.Any("organization", org))

Expand Down
6 changes: 3 additions & 3 deletions internal/service/org_preferences.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (s *DashNGoImpl) scopeIntoOrg(orgName string, runTask func() (interface{},

// UploadOrgPreferences Updates the preferences for a given organization. Returns error if org is not found.
func (s *DashNGoImpl) UploadOrgPreferences(orgName string, pref *models.Preferences) error {
f := func() (interface{}, error) {
runTask := func() (interface{}, error) {
if pref == nil {
return nil, fmt.Errorf("preferences are nil, cannot update")
}
Expand All @@ -85,10 +85,10 @@ func (s *DashNGoImpl) UploadOrgPreferences(orgName string, pref *models.Preferen
}
return status, nil
}
_, err := s.scopeIntoOrg(orgName, f)
_, err := s.scopeIntoOrg(orgName, runTask)
if err != nil {
return err
}
slog.Info("Organization Preferences were update")
slog.Info("Organization Preferences were updated")
return nil
}

0 comments on commit 0bba334

Please sign in to comment.