This commit is contained in:
@@ -855,7 +855,25 @@ export default {
|
||||
window.$gz.errorHandler.handleFormError(error, vm);
|
||||
}
|
||||
}
|
||||
},
|
||||
async sendResetCode() {
|
||||
let vm = this;
|
||||
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||
try {
|
||||
let res = await window.$gz.api.post(
|
||||
`auth/request-reset-password/${vm.obj.id}`,
|
||||
null
|
||||
);
|
||||
if (res.error) {
|
||||
vm.formState.serverError = res.error;
|
||||
window.$gz.form.setErrorBoxErrors(vm);
|
||||
}
|
||||
} catch (error) {
|
||||
window.$gz.errorHandler.handleFormError(error, vm);
|
||||
}
|
||||
}
|
||||
|
||||
//------more above here
|
||||
}
|
||||
};
|
||||
|
||||
@@ -923,6 +941,9 @@ async function clickHandler(menuItem) {
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "sendreset":
|
||||
m.vm.sendResetCode();
|
||||
break;
|
||||
default:
|
||||
window.$gz.eventBus.$emit(
|
||||
"notify-warning",
|
||||
@@ -1007,12 +1028,23 @@ function generateMenu(vm) {
|
||||
});
|
||||
}
|
||||
|
||||
menuOptions.menuItems.push({
|
||||
title: "DirectNotification",
|
||||
icon: "$ayiCommentAlt",
|
||||
key: FORM_KEY + ":directnotify",
|
||||
vm: vm
|
||||
});
|
||||
if (vm.$route.params.recordid != 0) {
|
||||
menuOptions.menuItems.push({
|
||||
title: "DirectNotification",
|
||||
icon: "$ayiCommentAlt",
|
||||
key: FORM_KEY + ":directnotify",
|
||||
vm: vm
|
||||
});
|
||||
|
||||
if (vm.rights.change) {
|
||||
menuOptions.menuItems.push({
|
||||
title: "SendPasswordResetCode",
|
||||
icon: null,
|
||||
key: FORM_KEY + ":sendreset",
|
||||
vm: vm
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
window.$gz.eventBus.$emit("menu-change", menuOptions);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user