Chore: Remove global database engine variable from annotation (#46940)

* Chore: Remove global database engine variable from annotation

* 💩
This commit is contained in:
Kat Yang
2022-03-25 13:23:09 -04:00
committed by GitHub
parent 19be0b4170
commit 90f2233ea9
6 changed files with 39 additions and 36 deletions

View File

@ -341,7 +341,7 @@ func (hs *HTTPServer) MassDeleteAnnotations(c *models.ReqContext) response.Respo
}
}
err = repo.Delete(deleteParams)
err = repo.Delete(c.Req.Context(), deleteParams)
if err != nil {
return response.Error(500, "Failed to delete annotations", err)
@ -376,7 +376,7 @@ func (hs *HTTPServer) DeleteAnnotationByID(c *models.ReqContext) response.Respon
return dashboardGuardianResponse(err)
}
err = repo.Delete(&annotations.DeleteParams{
err = repo.Delete(c.Req.Context(), &annotations.DeleteParams{
OrgId: c.OrgId,
Id: annotationID,
})
@ -422,7 +422,7 @@ func (hs *HTTPServer) GetAnnotationTags(c *models.ReqContext) response.Response
}
repo := annotations.GetRepository()
result, err := repo.FindTags(query)
result, err := repo.FindTags(c.Req.Context(), query)
if err != nil {
return response.Error(500, "Failed to find annotation tags", err)
}