You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by ab...@apache.org on 2023/07/20 10:35:43 UTC

[incubator-devlake] branch release-v0.18 updated: fix: skipCollectors add default value (#5710)

This is an automated email from the ASF dual-hosted git repository.

abeizn pushed a commit to branch release-v0.18
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/release-v0.18 by this push:
     new 62865c7d5 fix: skipCollectors add default value (#5710)
62865c7d5 is described below

commit 62865c7d5aaf01ef12c237c3c698d50fba18bde6
Author: abeizn <zi...@merico.dev>
AuthorDate: Thu Jul 20 18:26:00 2023 +0800

    fix: skipCollectors add default value (#5710)
    
    * fix: skipCollectors add default value
    
    * fix: skipCollectors add default value
---
 backend/server/api/blueprints/blueprints.go | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/backend/server/api/blueprints/blueprints.go b/backend/server/api/blueprints/blueprints.go
index d7517a664..ef2afc89c 100644
--- a/backend/server/api/blueprints/blueprints.go
+++ b/backend/server/api/blueprints/blueprints.go
@@ -184,10 +184,15 @@ func Trigger(c *gin.Context) {
 	var body struct {
 		SkipCollectors bool `json:"skipCollectors"`
 	}
-	err = c.ShouldBindJSON(&body)
-	if err != nil {
-		shared.ApiOutputError(c, errors.BadInput.Wrap(err, "error binding request body"))
-		return
+
+	if c.Request.Body == nil || c.Request.ContentLength == 0 {
+		body.SkipCollectors = false
+	} else {
+		err = c.ShouldBindJSON(&body)
+		if err != nil {
+			shared.ApiOutputError(c, errors.BadInput.Wrap(err, "error binding request body"))
+			return
+		}
 	}
 
 	pipeline, err := services.TriggerBlueprint(id, body.SkipCollectors)