diff --git a/ayanova/src/components/tag-picker.vue b/ayanova/src/components/tag-picker.vue index bc86200d..0cf65ca0 100644 --- a/ayanova/src/components/tag-picker.vue +++ b/ayanova/src/components/tag-picker.vue @@ -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); + } } },