This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
Reference in New Issue
Block a user