cleanup res.error overly complex

This commit is contained in:
2020-04-09 22:45:05 +00:00
parent baadc9c3c2
commit ae3baeb954
13 changed files with 32 additions and 34 deletions

View File

@@ -518,7 +518,7 @@ export default {
listView: untokenizedListView
})
.then(res => {
if (res.error != undefined) {
if (res.error) {
throw res.error;
} else {
//NOTE: This is how to call an async function and await it from sync code
@@ -774,7 +774,7 @@ function populateSelectionLists(vm) {
return window.$gz.api
.get("DataListView/ViewList?ListKey=" + vm.dataListKey)
.then(res => {
if (res.error != undefined) {
if (res.error) {
window.$gz.errorHandler.handleFormError(res.error, vm);
} else {
vm.selectLists.listViews = res.data;
@@ -792,7 +792,7 @@ function fetchListView(vm) {
return;
}
return window.$gz.api.get("DataListView/" + vm.listViewId).then(res => {
if (res.error != undefined) {
if (res.error) {
window.$gz.errorHandler.handleFormError(res.error, vm);
} else {
vm.listView = res.data.listView;