backend/services: Move GetDashboard from sqlstore to dashboard service (#48971)
* rename folder to match package name * backend/sqlstore: move GetDashboard into DashboardService This is a stepping-stone commit which copies the GetDashboard function - which lets us remove the sqlstore from the interfaces in dashboards - without changing any other callers. * checkpoint: moving GetDashboard calls into dashboard service * finish refactoring api tests for dashboardService.GetDashboard
This commit is contained in:
@@ -61,7 +61,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
OrgId: 1,
|
||||
}
|
||||
|
||||
err := sqlStore.GetDashboard(context.Background(), &query)
|
||||
err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, query.Result.Title, "test dash 23")
|
||||
@@ -78,7 +78,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
OrgId: 1,
|
||||
}
|
||||
|
||||
err := sqlStore.GetDashboard(context.Background(), &query)
|
||||
err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, query.Result.Title, "test dash 23")
|
||||
@@ -95,7 +95,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
OrgId: 1,
|
||||
}
|
||||
|
||||
err := sqlStore.GetDashboard(context.Background(), &query)
|
||||
err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, query.Result.Title, "test dash 23")
|
||||
@@ -111,7 +111,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
OrgId: 1,
|
||||
}
|
||||
|
||||
err := sqlStore.GetDashboard(context.Background(), &query)
|
||||
err := dashboardStore.GetDashboard(context.Background(), &query)
|
||||
require.Equal(t, err, models.ErrDashboardIdentifierNotSet)
|
||||
})
|
||||
|
||||
@@ -180,7 +180,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
OrgId: 1,
|
||||
}
|
||||
|
||||
err = sqlStore.GetDashboard(context.Background(), &query)
|
||||
err = dashboardStore.GetDashboard(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, query.Result.FolderId, int64(0))
|
||||
require.Equal(t, query.Result.CreatedBy, savedDash.CreatedBy)
|
||||
|
||||
Reference in New Issue
Block a user