public dashboards: rename api functions (#57789)
This PR imposes better naming conventions on public dashboards api * rename api functions and remove use of _config_ noun * fix tests Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
This commit is contained in:
@@ -71,7 +71,7 @@ func (d *PublicDashboardStoreImpl) FindDashboard(ctx context.Context, dashboardU
|
||||
return dashboard, err
|
||||
}
|
||||
|
||||
// Find Returns public dashboard configuration by Uid or nil if not found
|
||||
// Find Returns public dashboard by Uid or nil if not found
|
||||
func (d *PublicDashboardStoreImpl) Find(ctx context.Context, uid string) (*PublicDashboard, error) {
|
||||
if uid == "" {
|
||||
return nil, nil
|
||||
@@ -121,7 +121,7 @@ func (d *PublicDashboardStoreImpl) FindByAccessToken(ctx context.Context, access
|
||||
return pdRes, err
|
||||
}
|
||||
|
||||
// FindByDashboardUid Retrieves public dashboard configuration by dashboard uid
|
||||
// FindByDashboardUid Retrieves public dashboard by dashboard uid
|
||||
func (d *PublicDashboardStoreImpl) FindByDashboardUid(ctx context.Context, orgId int64, dashboardUid string) (*PublicDashboard, error) {
|
||||
if dashboardUid == "" {
|
||||
return nil, dashboards.ErrDashboardIdentifierNotSet
|
||||
@@ -148,8 +148,8 @@ func (d *PublicDashboardStoreImpl) FindByDashboardUid(ctx context.Context, orgId
|
||||
return pdRes, err
|
||||
}
|
||||
|
||||
// Save Persists public dashboard configuration
|
||||
func (d *PublicDashboardStoreImpl) Save(ctx context.Context, cmd SavePublicDashboardConfigCommand) error {
|
||||
// Save Persists public dashboard
|
||||
func (d *PublicDashboardStoreImpl) Save(ctx context.Context, cmd SavePublicDashboardCommand) error {
|
||||
if cmd.PublicDashboard.DashboardUid == "" {
|
||||
return dashboards.ErrDashboardIdentifierNotSet
|
||||
}
|
||||
@@ -166,8 +166,8 @@ func (d *PublicDashboardStoreImpl) Save(ctx context.Context, cmd SavePublicDashb
|
||||
return err
|
||||
}
|
||||
|
||||
// Update updates existing public dashboard configuration
|
||||
func (d *PublicDashboardStoreImpl) Update(ctx context.Context, cmd SavePublicDashboardConfigCommand) error {
|
||||
// Update updates existing public dashboard
|
||||
func (d *PublicDashboardStoreImpl) Update(ctx context.Context, cmd SavePublicDashboardCommand) error {
|
||||
err := d.sqlStore.WithTransactionalDbSession(ctx, func(sess *db.Session) error {
|
||||
timeSettingsJSON, err := json.Marshal(cmd.PublicDashboard.TimeSettings)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user