Skip to content
Snippets Groups Projects
Commit 4432eff1 authored by Alexey Lunin's avatar Alexey Lunin
Browse files

Added default empty object as data to generated penpal methods

parent 2bd7f8f4
No related branches found
No related tags found
1 merge request!30Fix error handling
......@@ -149,7 +149,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"
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment