Light improve of massive delete annotation api (#12390)

* fix delete annotations

* fix self assignment

* add right unit test using admin role
This commit is contained in:
Augustin
2018-06-25 04:58:49 -07:00
committed by Torkel Ödegaard
parent 3bf12e4ff5
commit eb4d860fcb
2 changed files with 49 additions and 2 deletions
+2 -2
View File
@@ -37,7 +37,6 @@ func GetAnnotations(c *m.ReqContext) Response {
if item.Email != "" {
item.AvatarUrl = dtos.GetGravatarUrl(item.Email)
}
item.Time = item.Time
}
return JSON(200, items)
@@ -214,7 +213,8 @@ func DeleteAnnotations(c *m.ReqContext, cmd dtos.DeleteAnnotationsCmd) Response
repo := annotations.GetRepository()
err := repo.Delete(&annotations.DeleteParams{
AlertId: cmd.PanelId,
Id: cmd.AnnotationId,
RegionId: cmd.RegionId,
DashboardId: cmd.DashboardId,
PanelId: cmd.PanelId,
})