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:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user