This commit is contained in:
2020-02-28 00:43:46 +00:00
parent fbb45da1ba
commit fe3e0117bf
8 changed files with 71 additions and 28 deletions

View File

@@ -288,8 +288,8 @@ export default {
window.$gz.eventBus.$on("menu-click", clickHandler);
//id 0 means create a new record don't load one
if (this.$route.params.id != 0) {
this.getDataFromApi(this.$route.params.id);
if (this.$route.params.recordid != 0) {
this.getDataFromApi(this.$route.params.recordid);
} else {
//setup for new record
var readOnly = !this.rights.change;
@@ -313,8 +313,8 @@ export default {
},
beforeRouteUpdate(to, from, next) {
//fetch the data for the record as if it's a new record
if (to.params.id != 0) {
this.getDataFromApi(to.params.id);
if (to.params.recordid != 0) {
this.getDataFromApi(to.params.recordid);
}
next();
// react to route changes...
@@ -485,7 +485,7 @@ export default {
if (this.canSave) {
this.formState.loading = true;
var vm = this;
var url = API_BASE_URL + this.$route.params.id;
var url = API_BASE_URL + this.$route.params.recordid;
//clear any errors vm might be around from previous submit
window.$gz.form.deleteAllErrorBoxErrors(this);
@@ -531,13 +531,13 @@ export default {
//do the delete
vm.formState.loading = true;
//No need to delete a new record, just abandon it...
if (this.$route.params.id == 0) {
if (this.$route.params.recordid == 0) {
//this should not get offered for delete but to be safe and clear just in case:
JUST_DELETED = true;
// navigate backwards
vm.$router.go(-1);
} else {
var url = API_BASE_URL + vm.$route.params.id;
var url = API_BASE_URL + vm.$route.params.recordid;
window.$gz.form.deleteAllErrorBoxErrors(vm);
window.$gz.api
@@ -567,10 +567,10 @@ export default {
});
},
duplicate() {
if (this.canDuplicate && this.$route.params.id != 0) {
if (this.canDuplicate && this.$route.params.recordid != 0) {
this.formState.loading = true;
var vm = this;
var url = API_BASE_URL + "duplicate/" + this.$route.params.id;
var url = API_BASE_URL + "duplicate/" + this.$route.params.recordid;
//clear any errors vm might be around from previous submit
window.$gz.form.deleteAllErrorBoxErrors(this);
@@ -659,7 +659,7 @@ function generateMenu(vm) {
formData: {
formKey: FORM_KEY,
ayaType: window.$gz.type.Widget,
recordId: vm.$route.params.id,
recordId: vm.$route.params.recordid,
formCustomTemplateKey: FORM_CUSTOM_TEMPLATE_KEY
},
menuItems: []