This commit is contained in:
@@ -12,7 +12,7 @@ import moment from 'moment-jalaali'
|
||||
import { useFormik } from 'formik'
|
||||
import { AddMessageTicketType, TicketMessageType } from './types/TicketTypes'
|
||||
import * as Yup from 'yup'
|
||||
import { toast } from 'react-toastify'
|
||||
import { toast } from '../../components/Toast';
|
||||
import { ErrorType } from '../../helpers/types'
|
||||
import { clx } from '../../helpers/utils'
|
||||
import { Pages } from '../../config/Pages'
|
||||
@@ -51,7 +51,7 @@ const TicketDetail: FC = () => {
|
||||
values.attachmentUrls = await data.data.map((item: { url: string }) => item?.url)
|
||||
},
|
||||
onError: (error: ErrorType) => {
|
||||
toast.error(error.response?.data?.error?.message[0])
|
||||
toast(error.response?.data?.error?.message[0] ?? t('error'), 'error')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@@ -60,7 +60,7 @@ const TicketDetail: FC = () => {
|
||||
|
||||
addMessage.mutate(values, {
|
||||
onSuccess: () => {
|
||||
toast.success(t('success'))
|
||||
toast(t('success'), 'success')
|
||||
formik.resetForm()
|
||||
setFiles([])
|
||||
setIsResetFiles(true)
|
||||
@@ -69,7 +69,7 @@ const TicketDetail: FC = () => {
|
||||
}, 1000);
|
||||
},
|
||||
onError: (error: ErrorType) => {
|
||||
toast.error(error.response?.data?.error?.message[0])
|
||||
toast(error.response?.data?.error?.message[0] ?? t('error'), 'error')
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -78,11 +78,11 @@ const TicketDetail: FC = () => {
|
||||
const hadleCloseTicket = () => {
|
||||
closeTicket.mutate(id ? id : '', {
|
||||
onSuccess: () => {
|
||||
toast.success(t('success'))
|
||||
toast(t('success'), 'success')
|
||||
navigate(Pages.ticket.list)
|
||||
},
|
||||
onError: (error: ErrorType) => {
|
||||
toast.error(error.response?.data?.error?.message[0])
|
||||
toast(error.response?.data?.error?.message[0] ?? t('error'), 'error')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user