This commit is contained in:
@@ -72,28 +72,27 @@ export default {
|
||||
readonly: { type: Boolean, default: false }
|
||||
},
|
||||
watch: {
|
||||
tagSearchEntry(val) {
|
||||
async tagSearchEntry(val) {
|
||||
let vm = this;
|
||||
if (!val || vm.tagSearchUnderway) {
|
||||
return;
|
||||
}
|
||||
vm.tagSearchUnderway = true;
|
||||
window.$gz.api
|
||||
.get("tag-list/list?query=" + val) //roles
|
||||
.then(res => {
|
||||
//We never expect there to be no data here
|
||||
if (!res.data) {
|
||||
throw res;
|
||||
}
|
||||
//adding this to the property will automatically have it cached by the autocomplete component
|
||||
//as cache-items has been set so this just needs to be set here once and all is well in future
|
||||
//Any search will be kept for later so this is very efficient
|
||||
vm.sourcetags = res.data;
|
||||
vm.tagSearchUnderway = false;
|
||||
})
|
||||
.catch(err => {
|
||||
window.$gz.errorHandler.handleFormError(err);
|
||||
});
|
||||
try {
|
||||
let res = await window.$gz.api.get("tag-list/list?query=" + val); //roles
|
||||
|
||||
//We never expect there to be no data here
|
||||
if (!res.data) {
|
||||
throw res;
|
||||
}
|
||||
//adding this to the property will automatically have it cached by the autocomplete component
|
||||
//as cache-items has been set so this just needs to be set here once and all is well in future
|
||||
//Any search will be kept for later so this is very efficient
|
||||
vm.sourcetags = res.data;
|
||||
vm.tagSearchUnderway = false;
|
||||
} catch (err) {
|
||||
window.$gz.errorHandler.handleFormError(err);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user