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

lynwee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 404408a59 fix: remote scope search reported invalid params (#6540)
404408a59 is described below

commit 404408a595a5d1ed97e57189e08a006e4a5d082f
Author: Klesh Wong <[email protected]>
AuthorDate: Thu Nov 30 15:35:02 2023 +0800

    fix: remote scope search reported invalid params (#6540)
    
    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")
        }

Reply via email to