Przeglądaj źródła

add option for new comments disable while creating environment

Mohammed Nafees 3 lat temu
rodzic
commit
082ed13b70

+ 1 - 1
api/server/handlers/environment/create.go

@@ -73,7 +73,7 @@ func (c *CreateEnvironmentHandler) ServeHTTP(w http.ResponseWriter, r *http.Requ
 		GitRepoBranches:     strings.Join(request.GitRepoBranches, ","),
 		Mode:                request.Mode,
 		WebhookID:           string(webhookUID),
-		NewCommentsDisabled: false,
+		NewCommentsDisabled: request.DisableNewComments,
 	}
 
 	// write Github actions files to the repo

+ 4 - 3
api/types/environment.go

@@ -19,9 +19,10 @@ type Environment struct {
 }
 
 type CreateEnvironmentRequest struct {
-	Name            string   `json:"name" form:"required"`
-	Mode            string   `json:"mode" form:"oneof=auto manual" default:"manual"`
-	GitRepoBranches []string `json:"git_repo_branches"`
+	Name               string   `json:"name" form:"required"`
+	Mode               string   `json:"mode" form:"oneof=auto manual" default:"manual"`
+	DisableNewComments bool     `json:"disable_new_comments"`
+	GitRepoBranches    []string `json:"git_repo_branches"`
 }
 
 type GitHubMetadata struct {