fix: return id from api when creating new annotation/graphite annotation, fixes #9798

When creating a region annotation the response will include both
id (region start id) and endId (region end id), if not only id.
This commit is contained in:
Marcus Efraimsson
2017-11-16 16:19:01 +01:00
parent 9ea5af578e
commit 540d540ea9
4 changed files with 53 additions and 20 deletions
+4 -2
View File
@@ -37,16 +37,18 @@ func TestAnnotations(t *testing.T) {
repo := SqlAnnotationRepo{}
Convey("Can save annotation", func() {
err := repo.Save(&annotations.Item{
annotation := &annotations.Item{
OrgId: 1,
UserId: 1,
DashboardId: 1,
Text: "hello",
Epoch: 10,
Tags: []string{"outage", "error", "type:outage", "server:server-1"},
})
}
err := repo.Save(annotation)
So(err, ShouldBeNil)
So(annotation.Id, ShouldBeGreaterThan, 0)
Convey("Can query for annotation", func() {
items, err := repo.Find(&annotations.ItemQuery{