From 7defb1adf583de6d086fde2c16475523c4c13dc0 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 23 Mar 2018 12:54:53 +0100 Subject: [PATCH] remove dashboardId check... i can't figure out how the tests work --- pkg/api/annotations.go | 5 ----- pkg/api/annotations_test.go | 9 ++++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/pkg/api/annotations.go b/pkg/api/annotations.go index 2c303f22b2b..e17cabb01a1 100644 --- a/pkg/api/annotations.go +++ b/pkg/api/annotations.go @@ -63,11 +63,6 @@ func PostAnnotation(c *m.ReqContext, cmd dtos.PostAnnotationsCmd) Response { return ApiError(500, "Failed to save annotation", err) } - if cmd.DashboardId == 0 { - err := &CreateAnnotationError{"Missing DashboardID"} - return ApiError(500, "Failed to save annotation", err) - } - item := annotations.Item{ OrgId: c.OrgId, UserId: c.UserId, diff --git a/pkg/api/annotations_test.go b/pkg/api/annotations_test.go index 94dfec10ddb..7c298550673 100644 --- a/pkg/api/annotations_test.go +++ b/pkg/api/annotations_test.go @@ -14,11 +14,10 @@ import ( func TestAnnotationsApiEndpoint(t *testing.T) { Convey("Given an annotation without a dashboard id", t, func() { cmd := dtos.PostAnnotationsCmd{ - Time: 1000, - Text: "annotation text", - Tags: []string{"tag1", "tag2"}, - IsRegion: false, - DashboardId: 5, + Time: 1000, + Text: "annotation text", + Tags: []string{"tag1", "tag2"}, + IsRegion: false, } updateCmd := dtos.UpdateAnnotationsCmd{