mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 21:08:12 +00:00
fix
This commit is contained in:
@@ -213,12 +213,15 @@ const UserManagementTree = () => {
|
||||
// Handle inviting or resending invitation to employees
|
||||
const handleInviteEmployee = async (employee: TeamMemberDto) => {
|
||||
try {
|
||||
// Show immediate feedback that action is being processed
|
||||
if (employee.status === "pending") {
|
||||
toast.loading("Resending verification code...");
|
||||
} else {
|
||||
toast.loading("Sending invitation...");
|
||||
}
|
||||
// A member who already set a password is being sent a fresh set-password
|
||||
// code — that is a reset, not an invite, so say so. Keyed off
|
||||
// hasSetPassword (the same fact the menu label uses) rather than the
|
||||
// looser `status` field, so the wording cannot disagree with the menu.
|
||||
const isReset = employee.user.hasSetPassword;
|
||||
|
||||
toast.loading(
|
||||
isReset ? "Sending password reset link..." : "Resending verification code...",
|
||||
);
|
||||
await resendVerificationCode({
|
||||
email: employee.user.email,
|
||||
phoneNumber: employee.user.phoneNumber,
|
||||
@@ -229,14 +232,14 @@ const UserManagementTree = () => {
|
||||
? localizedName(employee.user.name)
|
||||
: localizedName(employee.user.name) || "User";
|
||||
|
||||
if (employee.user.status === "pending") {
|
||||
toast.success("Verification Code Resent", {
|
||||
description: `A new verification code has been sent to ${userName}`,
|
||||
if (isReset) {
|
||||
toast.success("Password Reset Link Sent", {
|
||||
description: `${userName} can now set a new password. Any earlier code they had no longer works.`,
|
||||
duration: 4000,
|
||||
});
|
||||
} else {
|
||||
toast.success("Invitation Sent", {
|
||||
description: `Invitation sent to ${userName}`,
|
||||
toast.success("Verification Code Resent", {
|
||||
description: `A new verification code has been sent to ${userName}`,
|
||||
duration: 4000,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user