PublicDashboards: refactor service (#57372)
This commit is contained in:
@@ -258,8 +258,8 @@ func (d *PublicDashboardStoreImpl) UpdatePublicDashboardConfig(ctx context.Conte
|
||||
return err
|
||||
}
|
||||
|
||||
// Responds true if public dashboard for a dashboard exists and isEnabled
|
||||
func (d *PublicDashboardStoreImpl) PublicDashboardEnabled(ctx context.Context, dashboardUid string) (bool, error) {
|
||||
// EnabledPublicDashboardExistsByDashboardUid Responds true if there is an enabled public dashboard for a dashboard uid
|
||||
func (d *PublicDashboardStoreImpl) PublicDashboardEnabledExistsByDashboardUid(ctx context.Context, dashboardUid string) (bool, error) {
|
||||
hasPublicDashboard := false
|
||||
err := d.sqlStore.WithDbSession(ctx, func(dbSession *db.Session) error {
|
||||
sql := "SELECT COUNT(*) FROM dashboard_public WHERE dashboard_uid=? AND is_enabled=true"
|
||||
@@ -276,9 +276,8 @@ func (d *PublicDashboardStoreImpl) PublicDashboardEnabled(ctx context.Context, d
|
||||
return hasPublicDashboard, err
|
||||
}
|
||||
|
||||
// Responds true if accessToken exists and isEnabled. May be renamed in the
|
||||
// future
|
||||
func (d *PublicDashboardStoreImpl) AccessTokenExists(ctx context.Context, accessToken string) (bool, error) {
|
||||
// EnabledPublicDashboardExistsByAccessToken Responds true if accessToken exists and isEnabled
|
||||
func (d *PublicDashboardStoreImpl) PublicDashboardEnabledExistsByAccessToken(ctx context.Context, accessToken string) (bool, error) {
|
||||
hasPublicDashboard := false
|
||||
err := d.sqlStore.WithDbSession(ctx, func(dbSession *db.Session) error {
|
||||
sql := "SELECT COUNT(*) FROM dashboard_public WHERE access_token=? AND is_enabled=true"
|
||||
|
||||
Reference in New Issue
Block a user