Skip to content

Commit

Permalink
[FEAT] Added toast to find member page (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh3dev authored Jan 5, 2025
2 parents 4909e5f + 735678d commit 395da35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/(dashboard)/(routes)/findmember/Form/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { getSession } from 'next-auth/react';
import { FormButton } from '@/components/ui/FormButton';
import ErrorMessage from './ErrorMessage';
import MultiSelect from './MultiSelect';
import { toast } from 'react-toastify';

export default function Form (){
const {
Expand Down Expand Up @@ -91,13 +92,14 @@ export default function Form (){
const response = await axios.post('/api/post', data);
console.log('SUCCESS', response.data);
console.log('SUCCESS', data);

toast.success("Your team details have been submitted successfully!");
} catch (error: any) {
if (axios.isAxiosError(error)) {
console.error('Axios error:', error.response?.data);
} else {
console.error('Unexpected error:', error);
}
toast.error('Oops! Something went wrong. Please try again');
}
reset();
};
Expand Down

0 comments on commit 395da35

Please sign in to comment.