chore(dashboard version service): make method sigs more consistent (#60736)

The DashboardVersion struct is the database object; the DashboardVersionDTO is the object that should be sent to the API layer.

In the future I'd like to move DashboardVersion to dashverimpl and un-export it, but there are a few places that Insert directly into that table, not all of which are test fixtures, so that should wait until we clean up at least the DashboardService's use of it.
This commit is contained in:
Kristin Laemmert
2022-12-27 11:17:24 -05:00
committed by GitHub
parent 29276581d2
commit 6e9419ea80
9 changed files with 67 additions and 37 deletions
@@ -59,16 +59,15 @@ func (ss *sqlxStore) DeleteBatch(ctx context.Context, cmd *dashver.DeleteExpired
return deleted, err
}
func (ss *sqlxStore) List(ctx context.Context, query *dashver.ListDashboardVersionsQuery) ([]*dashver.DashboardVersionDTO, error) {
var dashboardVersion []*dashver.DashboardVersionDTO
func (ss *sqlxStore) List(ctx context.Context, query *dashver.ListDashboardVersionsQuery) ([]*dashver.DashboardVersion, error) {
var dashboardVersion []*dashver.DashboardVersion
qr := `SELECT dashboard_version.id,
dashboard_version.dashboard_id,
dashboard_version.parent_version,
dashboard_version.restored_from,
dashboard_version.version,
dashboard_version.created,
dashboard_version.message,
"user".login as created_by_login
dashboard_version.message
FROM dashboard_version
LEFT JOIN "user" ON "user".id = dashboard_version.created_by
LEFT JOIN dashboard ON dashboard.id = dashboard_version.dashboard_id