mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
remove unused GetDashboardSlugById function (#49116)
This commit is contained in:
parent
7ac9a0a087
commit
8169dcd9a2
@ -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=?`
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user