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
+3 -1
View File
@@ -290,7 +290,9 @@
"refer_ticket": "ارجاع تیکت", "refer_ticket": "ارجاع تیکت",
"user": "کاربر", "user": "کاربر",
"assign_to": "کارشناس پاسخگویی", "assign_to": "کارشناس پاسخگویی",
"user_plan": "پلن کاربر" "user_plan": "پلن کاربر",
"refer_ticket_success": "تیکت با موفقیت ارجاع شد",
"refer_ticket_error": "تیکت ارجاع نشد"
}, },
"active": "فعال", "active": "فعال",
"inactive": "غیرفعال", "inactive": "غیرفعال",
@@ -6,6 +6,8 @@ import CheckBoxComponent from '../../../components/CheckBoxComponent'
import { useParams } from 'react-router-dom' import { useParams } from 'react-router-dom'
import { useReferTicket } from '../hooks/useTicketData' import { useReferTicket } from '../hooks/useTicketData'
import Button from '../../../components/Button' import Button from '../../../components/Button'
import { toast } from 'react-toastify'
import { ErrorType } from '../../../helpers/types'
type Props = { type Props = {
refetch: () => void refetch: () => void
@@ -23,6 +25,10 @@ const ReferTicket: FC<Props> = ({ refetch }) => {
referTicket.mutate({ id: id as string, userId }, { referTicket.mutate({ id: id as string, userId }, {
onSuccess: () => { onSuccess: () => {
refetch() refetch()
toast.success(t('ticket.refer_ticket_success'))
},
onError: (error: ErrorType) => {
toast.error(error.response?.data?.error.message[0])
} }
}) })
} }