diff --git a/pkg/services/sqlstore/dashboard.go b/pkg/services/sqlstore/dashboard.go index 34d453e94c3..a8b1f48486d 100644 --- a/pkg/services/sqlstore/dashboard.go +++ b/pkg/services/sqlstore/dashboard.go @@ -293,28 +293,6 @@ func (ss *SQLStore) GetDashboardPermissionsForUser(ctx context.Context, query *m }) } -type DashboardSlugDTO struct { - Slug string -} - -func (ss *SQLStore) GetDashboardSlugById(ctx context.Context, query *models.GetDashboardSlugByIdQuery) error { - return ss.WithDbSession(ctx, func(dbSession *DBSession) error { - var rawSQL = `SELECT slug from dashboard WHERE Id=?` - var slug = DashboardSlugDTO{} - - exists, err := dbSession.SQL(rawSQL, query.Id).Get(&slug) - - if err != nil { - return err - } else if !exists { - return models.ErrDashboardNotFound - } - - query.Result = slug.Slug - return nil - }) -} - func (ss *SQLStore) GetDashboardUIDById(ctx context.Context, query *models.GetDashboardRefByIdQuery) error { return ss.WithDbSession(ctx, func(dbSession *DBSession) error { var rawSQL = `SELECT uid, slug from dashboard WHERE Id=?` diff --git a/pkg/services/sqlstore/mockstore/mockstore.go b/pkg/services/sqlstore/mockstore/mockstore.go index e6b102b0f9c..4747f1712e1 100644 --- a/pkg/services/sqlstore/mockstore/mockstore.go +++ b/pkg/services/sqlstore/mockstore/mockstore.go @@ -649,10 +649,6 @@ func (m *SQLStoreMock) GetDashboardPermissionsForUser(ctx context.Context, query return m.ExpectedError } -func (m *SQLStoreMock) GetDashboardSlugById(ctx context.Context, query *models.GetDashboardSlugByIdQuery) error { - return m.ExpectedError -} - func (m *SQLStoreMock) IsAdminOfTeams(ctx context.Context, query *models.IsAdminOfTeamsQuery) error { return m.ExpectedError } diff --git a/pkg/services/sqlstore/store.go b/pkg/services/sqlstore/store.go index a654be35be4..e071fd1178f 100644 --- a/pkg/services/sqlstore/store.go +++ b/pkg/services/sqlstore/store.go @@ -144,6 +144,5 @@ type Store interface { SearchOrgs(ctx context.Context, query *models.SearchOrgsQuery) error HasAdminPermissionInFolders(ctx context.Context, query *models.HasAdminPermissionInFoldersQuery) error GetDashboardPermissionsForUser(ctx context.Context, query *models.GetDashboardPermissionsForUserQuery) error - GetDashboardSlugById(ctx context.Context, query *models.GetDashboardSlugByIdQuery) error IsAdminOfTeams(ctx context.Context, query *models.IsAdminOfTeamsQuery) error }