ソースを参照

remove dashboardId check... i can't figure out how the tests work

ryan 7 年 前
コミット
7defb1adf5
2 ファイル変更4 行追加10 行削除
  1. 0 5
      pkg/api/annotations.go
  2. 4 5
      pkg/api/annotations_test.go

+ 0 - 5
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,

+ 4 - 5
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{