This commit is contained in:
2020-02-18 20:05:02 +00:00
parent cea5110d08
commit 9d3774f72d

View File

@@ -303,14 +303,8 @@ function generateMenu(vm) {
//
//
function initForm(vm) {
//fieldDefinitions
//return Promise.resolve();
return populateFieldDefinitions(vm);
//If need to call more then...:
// .then(() => {
// //Must use return here
// return initDataObject(vm);
// });
return populateFieldDefinitions(vm).then(fetchLocalizedFieldNames(vm));
}
////////////////////
@@ -321,7 +315,7 @@ function populateFieldDefinitions(vm) {
.get("DataList/ListFields?DataListKey=" + vm.dataListKey)
.then(res => {
if (res.error != undefined) {
window.$gz.errorHandler.handleFormError(res.error, vm);
throw res.error;
} else {
vm.fieldDefinitions = res.data;
}
@@ -339,14 +333,9 @@ function fetchLocalizedFieldNames(vm) {
columnKeys.push(cm.ltKey);
}
//Now fetch all the keys and await the response before returning
return window.$gz.locale
.fetch(columnKeys)
.then(() => {
return;
})
.catch(err => {
window.$gz.errorHandler.handleFormError(err);
});
return window.$gz.locale.fetch(columnKeys).then(() => {
return;
});
}
////////////////////