mirror of
https://github.com/grafana/grafana.git
synced 2025-02-11 16:15:42 -06:00
Fix: return proper values in dashboard thumbs service (#55421)
This commit is contained in:
parent
c946e44741
commit
7108b4331d
@ -22,40 +22,25 @@ func ProvideService(
|
||||
|
||||
func (s *Service) GetThumbnail(ctx context.Context, query *models.GetDashboardThumbnailCommand) (*models.DashboardThumbnail, error) {
|
||||
dt, err := s.store.Get(ctx, query)
|
||||
if err != nil {
|
||||
return dt, err
|
||||
}
|
||||
return dt, nil
|
||||
return dt, err
|
||||
}
|
||||
|
||||
func (s *Service) SaveThumbnail(ctx context.Context, cmd *models.SaveDashboardThumbnailCommand) (*models.DashboardThumbnail, error) {
|
||||
dt, err := s.store.Save(ctx, cmd)
|
||||
if err != nil {
|
||||
return dt, err
|
||||
}
|
||||
return dt, nil
|
||||
return dt, err
|
||||
}
|
||||
|
||||
func (s *Service) UpdateThumbnailState(ctx context.Context, cmd *models.UpdateThumbnailStateCommand) error {
|
||||
err := s.store.UpdateState(ctx, cmd)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Service) FindThumbnailCount(ctx context.Context, cmd *models.FindDashboardThumbnailCountCommand) (int64, error) {
|
||||
i, err := s.store.Count(ctx, cmd)
|
||||
if err != nil {
|
||||
return i, err
|
||||
}
|
||||
return 0, nil
|
||||
n, err := s.store.Count(ctx, cmd)
|
||||
return n, err
|
||||
}
|
||||
|
||||
func (s *Service) FindDashboardsWithStaleThumbnails(ctx context.Context, cmd *models.FindDashboardsWithStaleThumbnailsCommand) ([]*models.DashboardWithStaleThumbnail, error) {
|
||||
d, err := s.store.FindDashboardsWithStaleThumbnails(ctx, cmd)
|
||||
if err != nil {
|
||||
return d, err
|
||||
}
|
||||
return nil, nil
|
||||
thumbs, err := s.store.FindDashboardsWithStaleThumbnails(ctx, cmd)
|
||||
return thumbs, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user