fixed overlay not clearing delete bug
This commit is contained in:
@@ -683,33 +683,32 @@ export default {
|
||||
}
|
||||
},
|
||||
async remove() {
|
||||
const vm = this;
|
||||
try {
|
||||
const dialogResult = await window.$gz.dialog.confirmDelete();
|
||||
if (dialogResult != true) {
|
||||
return;
|
||||
}
|
||||
vm.formState.loading = true;
|
||||
if (vm.$route.params.recordid == 0) {
|
||||
this.formState.loading = true;
|
||||
if (this.$route.params.recordid == 0) {
|
||||
JUST_DELETED = true;
|
||||
vm.$router.go(-1);
|
||||
this.$router.go(-1);
|
||||
} else {
|
||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||
window.$gz.form.deleteAllErrorBoxErrors(this);
|
||||
const res = await window.$gz.api.remove(
|
||||
API_BASE_URL + vm.$route.params.recordid
|
||||
API_BASE_URL + this.$route.params.recordid
|
||||
);
|
||||
if (res.error) {
|
||||
vm.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
this.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(this);
|
||||
} else {
|
||||
JUST_DELETED = true;
|
||||
vm.$router.go(-1);
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
} catch (ex) {
|
||||
window.$gz.errorHandler.handleFormError(ex, vm);
|
||||
window.$gz.errorHandler.handleFormError(ex, this);
|
||||
} finally {
|
||||
vm.formState.loading = false;
|
||||
this.formState.loading = false;
|
||||
}
|
||||
},
|
||||
duplicate() {
|
||||
|
||||
Reference in New Issue
Block a user