DashboardService: Consolidate constructors (#31886)

* DashboardService: Consolidate constructors

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2021-03-12 11:51:02 +01:00
committed by GitHub
parent f917c2ab0f
commit 1716de88b5
8 changed files with 50 additions and 75 deletions
@@ -967,7 +967,7 @@ func callSaveWithResult(t *testing.T, cmd models.SaveDashboardCommand) *models.D
t.Helper()
dto := toSaveDashboardDto(cmd)
res, err := dashboards.NewService(nil).SaveDashboard(&dto, false)
res, err := dashboards.NewService().SaveDashboard(&dto, false)
require.NoError(t, err)
return res
@@ -975,7 +975,7 @@ func callSaveWithResult(t *testing.T, cmd models.SaveDashboardCommand) *models.D
func callSaveWithError(cmd models.SaveDashboardCommand) error {
dto := toSaveDashboardDto(cmd)
_, err := dashboards.NewService(nil).SaveDashboard(&dto, false)
_, err := dashboards.NewService().SaveDashboard(&dto, false)
return err
}
@@ -1001,7 +1001,7 @@ func saveTestDashboard(t *testing.T, title string, orgId int64, folderId int64)
},
}
res, err := dashboards.NewService(nil).SaveDashboard(&dto, false)
res, err := dashboards.NewService().SaveDashboard(&dto, false)
require.NoError(t, err)
return res
@@ -1028,7 +1028,7 @@ func saveTestFolder(t *testing.T, title string, orgId int64) *models.Dashboard {
},
}
res, err := dashboards.NewService(nil).SaveDashboard(&dto, false)
res, err := dashboards.NewService().SaveDashboard(&dto, false)
require.NoError(t, err)
return res