toast for reffer ticket

This commit is contained in:
hamid zarghami
2025-05-11 14:38:46 +03:30
parent 1447a64491
commit 052280a009
2 changed files with 9 additions and 1 deletions
@@ -6,6 +6,8 @@ import CheckBoxComponent from '../../../components/CheckBoxComponent'
import { useParams } from 'react-router-dom'
import { useReferTicket } from '../hooks/useTicketData'
import Button from '../../../components/Button'
import { toast } from 'react-toastify'
import { ErrorType } from '../../../helpers/types'
type Props = {
refetch: () => void
@@ -23,6 +25,10 @@ const ReferTicket: FC<Props> = ({ refetch }) => {
referTicket.mutate({ id: id as string, userId }, {
onSuccess: () => {
refetch()
toast.success(t('ticket.refer_ticket_success'))
},
onError: (error: ErrorType) => {
toast.error(error.response?.data?.error.message[0])
}
})
}