This commit is contained in:
2020-06-19 23:13:37 +00:00
parent 606f91092f
commit 3935d43db5

View File

@@ -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);
}
}
},