Update JS, to use API auto complete routes.

This commit is contained in:
James Cole 2020-07-19 13:04:22 +02:00
parent f3a55e6cee
commit 3b56f4271e
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
3 changed files with 13 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -104,10 +104,9 @@
},
mounted() {
this.target = this.$refs.input;
let types = this.allowedTypes.join(',');
this.updateACURI(this.allowedTypes.join(','));
// console.log('mounted(): this.name = this.accountName (' + this.accountName + ')');
this.name = this.accountName;
this.accountAutoCompleteURI = document.getElementsByTagName('base')[0].href + "json/accounts?types=" + types + "&search=";
this.triggerTransactionType();
},
@ -124,7 +123,7 @@
if (0 === this.accountTypeFilters.length) {
types = this.defaultAccountTypeFilters.join(',');
}
this.accountAutoCompleteURI = document.getElementsByTagName('base')[0].href + "json/accounts?types=" + types + "&search=";
this.updateACURI(types);
},
name() {
// console.log('Watch: name()');
@ -142,6 +141,15 @@
// any error handler
})
},
updateACURI: function (types) {
this.accountAutoCompleteURI =
document.getElementsByTagName('base')[0].href +
'api/v1/autocomplete/accounts' +
'?types=' +
types +
'&query=';
console.log('Auto complete URI is now ' + this.accountAutoCompleteURI);
},
hasError: function () {
return this.error.length > 0;
},