Skip to content
Snippets Groups Projects
Commit f867fe34 authored by Alexey Kuklin's avatar Alexey Kuklin
Browse files

Merge branch 'fix-error-handling' into 'master'

Fix error handling

See merge request !30
parents 5e74bb32 d4e5e218
No related branches found
No related tags found
1 merge request!30Fix error handling
......@@ -123,7 +123,13 @@ func buildViamAPI() string {
}
}
result += "ViamAPI.prototype." + packageStr + strings.Title(methodStr) + " = function(config, " + args + ") {\n" +
lastComma := ","
if args == "" {
lastComma = ""
}
result += "ViamAPI.prototype." + packageStr + strings.Title(methodStr) + " = function(config" + lastComma + args + ") {\n" +
" return axios.post(window.API_HOST + '" + packageStr + "/" + methodStr + "', {\n"
for i := 0; i < lenFields; i++ {
......@@ -149,7 +155,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.
Please register or to comment