change toast
deploy to danak / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-07-20 10:55:33 +03:30
parent feed194673
commit d3fd21177b
97 changed files with 437 additions and 411 deletions
+6 -6
View File
@@ -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')
}
})
}