You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2023/11/30 07:25:54 UTC

(incubator-devlake) branch kw-5519-dshelper created (now 031f7054f)

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

klesh pushed a change to branch kw-5519-dshelper
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


      at 031f7054f fix: remote scope search reported invalid params

This branch includes the following new commits:

     new 031f7054f fix: remote scope search reported invalid params

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(incubator-devlake) 01/01: fix: remote scope search reported invalid params

Posted by kl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

klesh pushed a commit to branch kw-5519-dshelper
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 031f7054ff277d044ddef4a79f88fa6a8b2a15dc
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Thu Nov 30 15:24:38 2023 +0800

    fix: remote scope search reported invalid params
    
      Closes #6539
---
 .../pluginhelper/api/ds_remote_api_scope_search_helper.go    | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/backend/helpers/pluginhelper/api/ds_remote_api_scope_search_helper.go b/backend/helpers/pluginhelper/api/ds_remote_api_scope_search_helper.go
index ab076ffce..ca41c20d0 100644
--- a/backend/helpers/pluginhelper/api/ds_remote_api_scope_search_helper.go
+++ b/backend/helpers/pluginhelper/api/ds_remote_api_scope_search_helper.go
@@ -21,8 +21,7 @@ import (
 	"github.com/apache/incubator-devlake/core/errors"
 	"github.com/apache/incubator-devlake/core/plugin"
 	"github.com/apache/incubator-devlake/helpers/pluginhelper/api/models"
-	"github.com/mitchellh/mapstructure"
-	// "github.com/apache/incubator-devlake/helpers/utils"
+	"github.com/apache/incubator-devlake/helpers/utils"
 )
 
 type DsSearchRemoteScopes[C plugin.ToolLayerApiConnection, S plugin.ToolLayerScope] func(
@@ -56,13 +55,10 @@ func (rss *DsRemoteApiScopeSearchHelper[C, S]) Get(input *plugin.ApiResourceInpu
 		Page:     1,
 		PageSize: 50,
 	}
-	if e := mapstructure.Decode(input.Query, params); e != nil {
-		return nil, errors.BadInput.Wrap(e, "invalid params")
+	err = utils.DecodeMapStruct(input.Query, params, true)
+	if err != nil {
+		return nil, err
 	}
-	// err = utils.DecodeMapStruct(input.Query, params, true)
-	// if err != nil {
-	// 	return nil, err
-	// }
 	if e := vld.Struct(params); e != nil {
 		return nil, errors.BadInput.Wrap(e, "invalid params")
 	}