diff --git a/pkg/models/dashboard_snapshot.go b/pkg/models/dashboard_snapshot.go index 57c5524ace8..9273b88f291 100644 --- a/pkg/models/dashboard_snapshot.go +++ b/pkg/models/dashboard_snapshot.go @@ -73,11 +73,12 @@ type GetDashboardSnapshotQuery struct { } type DashboardSnapshots []*DashboardSnapshot +type DashboardSnapshotsList []*DashboardSnapshotDTO type GetDashboardSnapshotsQuery struct { Name string Limit int OrgId int64 - Result DashboardSnapshots + Result DashboardSnapshotsList } diff --git a/pkg/services/sqlstore/dashboard_snapshot.go b/pkg/services/sqlstore/dashboard_snapshot.go index 810189b3246..0ef7f99da67 100644 --- a/pkg/services/sqlstore/dashboard_snapshot.go +++ b/pkg/services/sqlstore/dashboard_snapshot.go @@ -86,9 +86,10 @@ func GetDashboardSnapshot(query *m.GetDashboardSnapshotQuery) error { } func SearchDashboardSnapshots(query *m.GetDashboardSnapshotsQuery) error { - var snapshots = make(m.DashboardSnapshots, 0) + var snapshots = make(m.DashboardSnapshotsList, 0) sess := x.Limit(query.Limit) + sess.Table("dashboard_snapshot") if query.Name != "" { sess.Where("name LIKE ?", query.Name)