diff --git a/main.go b/main.go index 3ed20e56b22d713a4c8a48fdb6033b327f9bf1f0..83c19174e913fd9c85fc6850865bb00d58ea9d97 100644 --- a/main.go +++ b/main.go @@ -136,7 +136,7 @@ func buildViamAPI() string { result += "\n" } - result += " }, merge(this.config, config));\n" + + result += " }, merge({}, this.config, config));\n" + "};\n\n" } else { splits := strings.Split(url, "/") @@ -151,7 +151,7 @@ func buildViamAPI() string { methodStr := splits[len(splits)-1] result += "ViamAPI.prototype." + packageStr + strings.Title(methodStr) + " = function(config, data) {\n" + - " return axios.post(window.API_HOST + '" + packageStr + "/" + methodStr + "', data, merge(this.config, config));\n" + + " return axios.post(window.API_HOST + '" + packageStr + "/" + methodStr + "', data, merge({}, this.config, config));\n" + "};\n\n" } }