Chore: Remove bus from dashboard service (#46829)

* Move DeleteDashboard funtion into dashboards store service, remove bus and update tests

* Remove bus from folder service and update more tests

* Fix mock
This commit is contained in:
Selene
2022-03-22 14:36:50 +01:00
committed by GitHub
parent bfb03d779d
commit b2af18f129
15 changed files with 183 additions and 202 deletions
+4 -3
View File
@@ -245,9 +245,10 @@ func TestAlertingDataAccess(t *testing.T) {
err := sqlStore.SaveAlerts(context.Background(), testDash.Id, items)
require.Nil(t, err)
err = sqlStore.DeleteDashboard(context.Background(), &models.DeleteDashboardCommand{
OrgId: 1,
Id: testDash.Id,
err = sqlStore.WithDbSession(context.Background(), func(sess *DBSession) error {
dash := models.Dashboard{Id: testDash.Id, OrgId: 1}
_, err := sess.Delete(dash)
return err
})
require.Nil(t, err)