Chore: Add context to star and stats (#39591)

* Add context to star and stats

* Use WithTransactionalDbSession

* Add additional ctx

* Remove convey

* Fix star handler name

* Use WithDbSession, use DispatchCtx

* Remove xorm from star
This commit is contained in:
idafurjes
2021-09-28 17:54:45 +02:00
committed by GitHub
parent 580cdc46fc
commit b255c1b992
11 changed files with 71 additions and 67 deletions
+2 -2
View File
@@ -386,13 +386,13 @@ func TestDashboardDataAccess(t *testing.T) {
Convey("Given two dashboards, one is starred dashboard by user 10, other starred by user 1", func() {
starredDash := insertTestDashboard(t, sqlStore, "starred dash", 1, 0, false)
err := StarDashboard(&models.StarDashboardCommand{
err := sqlStore.StarDashboard(context.Background(), &models.StarDashboardCommand{
DashboardId: starredDash.Id,
UserId: 10,
})
So(err, ShouldBeNil)
err = StarDashboard(&models.StarDashboardCommand{
err = sqlStore.StarDashboard(context.Background(), &models.StarDashboardCommand{
DashboardId: savedDash.Id,
UserId: 1,
})