remove unused GetDashboardSlugById function (#49116)

This commit is contained in:
Kristin Laemmert 2022-05-18 08:17:17 -04:00 committed by GitHub
parent 7ac9a0a087
commit 8169dcd9a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 27 deletions

View File

@ -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=?`

View File

@ -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
}

View File

@ -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
}