This commit is contained in:
@@ -310,15 +310,11 @@ let editor = null;
|
||||
export default {
|
||||
async created() {
|
||||
let vm = this;
|
||||
//Not valid without report data options
|
||||
if (vm.$route.params.reportDataOptions == null) {
|
||||
throw new Error(
|
||||
"ay-report-edit::created - missing report data options cannot proceed"
|
||||
);
|
||||
// // navigate backwards
|
||||
vm.$router.go(-1);
|
||||
return;
|
||||
}
|
||||
|
||||
// console.log(
|
||||
// "ay-report created reportdataoptions:",
|
||||
// vm.$route.params.reportDataOptions
|
||||
// );
|
||||
|
||||
try {
|
||||
await initForm(vm);
|
||||
@@ -339,6 +335,7 @@ export default {
|
||||
//yes, no need to fetch it
|
||||
this.obj = this.$route.params.obj;
|
||||
} else {
|
||||
//FETCH EXISTING
|
||||
await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading
|
||||
}
|
||||
} else {
|
||||
@@ -353,6 +350,16 @@ export default {
|
||||
setDirty = true;
|
||||
} else {
|
||||
//brand new report, not a duplicate or previous data
|
||||
//Not valid without report data options
|
||||
if (vm.$route.params.reportDataOptions == null) {
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-error",
|
||||
"ay-report-edit::created - missing report data options cannot proceed"
|
||||
);
|
||||
// // navigate backwards
|
||||
vm.$router.go(-1);
|
||||
return;
|
||||
}
|
||||
vm.obj.aType = vm.$route.params.reportDataOptions.AType;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user