diff --git a/src/views/connected/admin/conseillers/ConseillerDetails.js b/src/views/connected/admin/conseillers/ConseillerDetails.js index 2eb19247..a0053741 100644 --- a/src/views/connected/admin/conseillers/ConseillerDetails.js +++ b/src/views/connected/admin/conseillers/ConseillerDetails.js @@ -21,7 +21,9 @@ function ConseillerDetails() { const loading = useSelector(state => state.conseiller?.loading); const roleActivated = useSelector(state => state.authentication?.roleActivated); const successSendMail = useSelector(state => state.conseiller?.successRelanceInvitation); + const successSendMailCandidat = useSelector(state => state.conseiller?.successResendInvitCandidatConseiller); const errorSendMail = useSelector(state => state.conseiller?.errorRelanceInvitation); + const errorSendMailCandidat = useSelector(state => state.conseiller?.errorCandidat); const currentPage = useSelector(state => state.pagination?.currentPage); const [misesEnRelationFinalisee, setMisesEnRelationFinalisee] = useState([]); @@ -31,6 +33,10 @@ function ConseillerDetails() { const resendInvitationEspaceCoop = conseillerId => { dispatch(conseillerActions.resendInvitConseiller(conseillerId)); }; + const resendInvitCandidat = () => { + window.scrollTo(0, 0); + dispatch(conseillerActions.resendInvitCandidat(conseiller?._id)); + }; useEffect(() => { if (!errorConseiller) { @@ -81,7 +87,22 @@ function ConseillerDetails() { status: null, description: null })); } - }, [successSendMail, errorSendMail]); + + if (successSendMailCandidat) { + dispatch(alerteEtSpinnerActions.getMessageAlerte({ + type: 'success', + message: successSendMailCandidat, + status: null, description: null + })); + } + if (errorSendMailCandidat) { + dispatch(alerteEtSpinnerActions.getMessageAlerte({ + type: 'error', + message: errorSendMailCandidat, + status: null, description: null + })); + } + }, [successSendMail, errorSendMail, successSendMailCandidat, errorSendMailCandidat]); return (
@@ -156,10 +177,10 @@ function ConseillerDetails() { }
} -
- {conseiller?.statut === 'RECRUTE' && +
+ {conseiller?.statut === 'RECRUTE' && <> + {conseiller?.usersActived[0]?.passwordCreated === true && + + } + }