Chore: Deprecate FolderID from GetDashboardQuery (#77812)
This commit is contained in:
@@ -884,6 +884,7 @@ func (d *dashboardStore) deleteAlertDefinition(dashboardId int64, sess *db.Sessi
|
||||
func (d *dashboardStore) GetDashboard(ctx context.Context, query *dashboards.GetDashboardQuery) (*dashboards.Dashboard, error) {
|
||||
var queryResult *dashboards.Dashboard
|
||||
err := d.store.WithDbSession(ctx, func(sess *db.Session) error {
|
||||
// nolint:staticcheck
|
||||
if query.ID == 0 && len(query.UID) == 0 && (query.Title == nil || query.FolderID == nil) {
|
||||
return dashboards.ErrDashboardIdentifierNotSet
|
||||
}
|
||||
@@ -894,6 +895,7 @@ func (d *dashboardStore) GetDashboard(ctx context.Context, query *dashboards.Get
|
||||
dashboard.Title = *query.Title
|
||||
mustCols = append(mustCols, "title")
|
||||
}
|
||||
// nolint:staticcheck
|
||||
if query.FolderID != nil {
|
||||
dashboard.FolderID = *query.FolderID
|
||||
mustCols = append(mustCols, "folder_id")
|
||||
|
||||
@@ -93,7 +93,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
setup()
|
||||
query := dashboards.GetDashboardQuery{
|
||||
Title: util.Pointer("test dash 23"),
|
||||
FolderID: &savedFolder.ID,
|
||||
FolderID: &savedFolder.ID, // nolint:staticcheck
|
||||
OrgID: 1,
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
setup()
|
||||
query := dashboards.GetDashboardQuery{
|
||||
Title: util.Pointer("test dash 23"),
|
||||
FolderID: util.Pointer(int64(0)),
|
||||
FolderID: util.Pointer(int64(0)), // nolint:staticcheck
|
||||
OrgID: 1,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user