toast for reffer ticket
This commit is contained in:
+3
-1
@@ -290,7 +290,9 @@
|
||||
"refer_ticket": "ارجاع تیکت",
|
||||
"user": "کاربر",
|
||||
"assign_to": "کارشناس پاسخگویی",
|
||||
"user_plan": "پلن کاربر"
|
||||
"user_plan": "پلن کاربر",
|
||||
"refer_ticket_success": "تیکت با موفقیت ارجاع شد",
|
||||
"refer_ticket_error": "تیکت ارجاع نشد"
|
||||
},
|
||||
"active": "فعال",
|
||||
"inactive": "غیرفعال",
|
||||
|
||||
@@ -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])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user