This commit is contained in:
2020-06-19 23:00:45 +00:00
parent f79fed7154
commit 160d84d954

View File

@@ -483,8 +483,9 @@ export default {
//i is the actual AyaNova index of vm record so we have all we need to open vm object
window.$gz.eventBus.$emit("openobject", { type: typeToOpen, id: i });
},
getDataFromApi() {
async getDataFromApi() {
let vm = this;
if (vm.loading) {
return;
}
@@ -507,22 +508,20 @@ export default {
//this puts a pin in it then resets it after the fetch is completed
let preSelected = [...vm.selected];
try {
//untokenize ListView date token criteria (if there are any)
let untokenizedListView = untokenizeListView(vm.listView);
window.$gz.api
.upsert(vm.apiBaseUrl, {
let res = await window.$gz.api.upsert(vm.apiBaseUrl, {
offset: listOptions.Offset,
limit: listOptions.Limit,
dataListKey: vm.dataListKey,
listView: untokenizedListView
})
.then(res => {
});
if (res.error) {
throw res.error;
} else {
//NOTE: This is how to call an async function and await it from sync code
(async function() {
//Save a copy of the server columns data for handling button clicks etc later
vm.serverColumns = res.columns;
//Make sure the translation keys are fetched
@@ -540,17 +539,13 @@ export default {
//persist the paging options and listview stuff so user sees same page and list on refresh or leave and return scenario
saveFormSettings(vm);
//////////
})();
}
})
.catch(err => {
} catch (err) {
window.$gz.errorHandler.handleFormError(err, vm);
})
.finally(function() {
} finally {
vm.loading = false;
vm.formState.ready = true;
});
}
}
},
created() {