mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 12:28:21 +00:00
fix
This commit is contained in:
@@ -81,12 +81,17 @@ export const OrganizationEmployeeSearch: React.FC<
|
||||
const handleInviteEmployee = async (employee: TeamMemberDto) => {
|
||||
const lang = i18n.language;
|
||||
try {
|
||||
// Show immediate feedback that action is being processed
|
||||
if (employee.user.status === "pending") {
|
||||
toast.loading(t("search.resendingVerification"));
|
||||
} else {
|
||||
toast.loading(t("search.sendingInvitation"));
|
||||
}
|
||||
// A member who already set a password is being sent a fresh set-password
|
||||
// code — that is a reset, not an invite. Keyed off hasSetPassword (the
|
||||
// same fact the menu label uses) rather than the looser `status` field,
|
||||
// so the wording cannot disagree with the menu the operator clicked.
|
||||
const isReset = employee.user.hasSetPassword;
|
||||
|
||||
toast.loading(
|
||||
isReset
|
||||
? t("search.sendingPasswordReset")
|
||||
: t("search.resendingVerification"),
|
||||
);
|
||||
|
||||
await resendVerificationCode({
|
||||
email: employee.user.email,
|
||||
@@ -97,14 +102,14 @@ export const OrganizationEmployeeSearch: React.FC<
|
||||
const userName =
|
||||
lang === "en" ? employee.user.name.en : employee.user.name.am;
|
||||
|
||||
if (employee.user.status === "pending") {
|
||||
toast.success(t("search.verificationCodeResent"), {
|
||||
description: t("search.verificationCodeSentTo", { name: userName }),
|
||||
if (isReset) {
|
||||
toast.success(t("search.passwordResetSent"), {
|
||||
description: t("search.passwordResetSentTo", { name: userName }),
|
||||
duration: 4000,
|
||||
});
|
||||
} else {
|
||||
toast.success(t("search.invitationSent"), {
|
||||
description: t("search.invitationSentTo", { name: userName }),
|
||||
toast.success(t("search.verificationCodeResent"), {
|
||||
description: t("search.verificationCodeSentTo", { name: userName }),
|
||||
duration: 4000,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user