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 14:24:56 +01:00
parent 9ea5af578e
commit 540d540ea9
4 changed files with 53 additions and 20 deletions

View File

@ -288,11 +288,11 @@ func (hs *HttpServer) registerRoutes() {
apiRoute.Post("/annotations/mass-delete", reqOrgAdmin, bind(dtos.DeleteAnnotationsCmd{}), wrap(DeleteAnnotations))
apiRoute.Group("/annotations", func(annotationsRoute RouteRegister) {
annotationsRoute.Post("/", bind(dtos.PostAnnotationsCmd{}), wrap(PostAnnotation))
annotationsRoute.Post("/", bind(dtos.PostAnnotationsCmd{}), PostAnnotation)
annotationsRoute.Delete("/:annotationId", wrap(DeleteAnnotationById))
annotationsRoute.Put("/:annotationId", bind(dtos.UpdateAnnotationsCmd{}), wrap(UpdateAnnotation))
annotationsRoute.Delete("/region/:regionId", wrap(DeleteAnnotationRegion))
annotationsRoute.Post("/graphite", bind(dtos.PostGraphiteAnnotationsCmd{}), wrap(PostGraphiteAnnotation))
annotationsRoute.Post("/graphite", bind(dtos.PostGraphiteAnnotationsCmd{}), PostGraphiteAnnotation)
}, reqEditorRole)
// error test