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 } readonly: { type: Boolean, default: false }
}, },
watch: { watch: {
tagSearchEntry(val) { async tagSearchEntry(val) {
let vm = this; let vm = this;
if (!val || vm.tagSearchUnderway) { if (!val || vm.tagSearchUnderway) {
return; return;
} }
vm.tagSearchUnderway = true; vm.tagSearchUnderway = true;
window.$gz.api try {
.get("tag-list/list?query=" + val) //roles let res = await window.$gz.api.get("tag-list/list?query=" + val); //roles
.then(res => {
//We never expect there to be no data here //We never expect there to be no data here
if (!res.data) { if (!res.data) {
throw res; throw res;
} }
//adding this to the property will automatically have it cached by the autocomplete component //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 //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 //Any search will be kept for later so this is very efficient
vm.sourcetags = res.data; vm.sourcetags = res.data;
vm.tagSearchUnderway = false; vm.tagSearchUnderway = false;
}) } catch (err) {
.catch(err => { window.$gz.errorHandler.handleFormError(err);
window.$gz.errorHandler.handleFormError(err); }
});
} }
}, },