Skip to content

Commit

Permalink
Added toast success message on successful send of set up link
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilgiri0226 committed Nov 21, 2024
1 parent 7aaf746 commit fc76fc4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/components/UserManagement/setupNewUserPopup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ const SetupNewUserPopup = React.memo(props => {
.post(ENDPOINTS.SETUP_NEW_USER(), { baseUrl, email, weeklyCommittedHours })
.then(res => {
if (res.status === 200) {
props.handleShouldRefreshInvitationHistory();
toast.success('The setup link has been successfully sent');
closePopup();
} else {
setAlert({ visibility: 'visible', message: 'An error has occurred', state: 'error' });
}
})
.catch(err => {
if (err.response?.data === 'email already in use') {
if (err.response.data === 'email already in use') {
setAlert({
visibility: 'visible',
message: 'This email is associated with an existing user account.',
Expand All @@ -57,7 +55,6 @@ const SetupNewUserPopup = React.memo(props => {
setTimeout(() => {
setAlert({ visibility: 'hidden', message: '', state: 'success' });
setEmail('');
setWeeklyCommittedHours(0);
}, 2000);
// Prevent multiple requests to fetch invitation history
const deboucingRefreshHistory = _.debounce(() => {
Expand Down

0 comments on commit fc76fc4

Please sign in to comment.