This commit is contained in:
@@ -240,7 +240,7 @@ export default {
|
||||
// }
|
||||
// }
|
||||
},
|
||||
getList: function(urlParams) {
|
||||
getList: async function(urlParams) {
|
||||
let vm = this;
|
||||
if (vm.fetching) {
|
||||
return;
|
||||
@@ -253,22 +253,21 @@ export default {
|
||||
urlParams += "&inactive=true";
|
||||
}
|
||||
}
|
||||
window.$gz.api
|
||||
.get("pick-list/List" + urlParams)
|
||||
.then(res => {
|
||||
vm.fetching = false;
|
||||
//We never expect there to be no data here
|
||||
if (!res.data) {
|
||||
throw res;
|
||||
}
|
||||
vm.searchResults = res.data;
|
||||
window.$gz.form.addNoSelectionItem(vm.searchResults);
|
||||
vm.replaceLastSelection();
|
||||
})
|
||||
.catch(err => {
|
||||
window.$gz.errorHandler.handleFormError(err);
|
||||
vm.fetching = false;
|
||||
});
|
||||
try {
|
||||
let res = await window.$gz.api.get("pick-list/List" + urlParams);
|
||||
|
||||
vm.fetching = false;
|
||||
//We never expect there to be no data here
|
||||
if (!res.data) {
|
||||
throw res;
|
||||
}
|
||||
vm.searchResults = res.data;
|
||||
window.$gz.form.addNoSelectionItem(vm.searchResults);
|
||||
vm.replaceLastSelection();
|
||||
} catch (err) {
|
||||
window.$gz.errorHandler.handleFormError(err);
|
||||
vm.fetching = false;
|
||||
}
|
||||
},
|
||||
doSearch: _.debounce(function(searchFor) {
|
||||
//NOTE debounce with a watcher is a bit different, currently it has to be done exactly this way, nothing else will work properly
|
||||
|
||||
Reference in New Issue
Block a user