Fixed wrong URL construction in ajax call

This commit is contained in:
Eliot Berriot 2018-01-07 22:49:20 +01:00
parent cadf3f3168
commit 04ae5c8648
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
2 changed files with 7 additions and 2 deletions

View File

@ -2,10 +2,14 @@ Changelog
========= =========
0.3.4 (Unreleased) 0.3.6 (Unreleased)
------------------ ------------------
0.3.5 (2018-01-07)
------------------
- Fixed wrong URL construction in ajax call
0.3.4 (2018-01-07) 0.3.4 (2018-01-07)

View File

@ -112,8 +112,9 @@ export default {
selector.push('.autocomplete') selector.push('.autocomplete')
settings.fields = f.autocomplete_fields settings.fields = f.autocomplete_fields
settings.minCharacters = 1 settings.minCharacters = 1
let backendUrl = config.BACKEND_URL || window.location.protocol + '//' + window.location.hostname + ':' + window.location.port
settings.apiSettings = { settings.apiSettings = {
url: config.BACKEND_URL + f.autocomplete + '?' + f.autocomplete_qs, url: backendUrl + f.autocomplete + '?' + f.autocomplete_qs,
beforeXHR: function (xhrObject) { beforeXHR: function (xhrObject) {
xhrObject.setRequestHeader('Authorization', self.$store.getters['auth/header']) xhrObject.setRequestHeader('Authorization', self.$store.getters['auth/header'])
return xhrObject return xhrObject