fix bug toast and do not change slug id
This commit is contained in:
@@ -4,7 +4,7 @@ import { TickCircle } from 'iconsax-react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useApproveInvoice, useRequestApprove } from '../hooks/useReceiptData'
|
||||
import { ErrorType } from '../../../helpers/types'
|
||||
import { toast } from 'react-toastify'
|
||||
import { toast } from '../../../components/Toast'
|
||||
import { clx } from '../../../helpers/utils'
|
||||
import { useGetProfile } from '../../profile/hooks/useProfileData'
|
||||
import { RequestApproveInvoiceType } from '../types/ReceiptTypes'
|
||||
@@ -31,12 +31,12 @@ const ApproveInvoice: FC<Props> = ({ id, refetch, status }) => {
|
||||
const handleConfrim = () => {
|
||||
approveInvoce.mutate({ code: code, id: id, phone: getProfile.data?.data?.user?.phone }, {
|
||||
onSuccess: () => {
|
||||
toast.success(t('success'))
|
||||
toast('فاکتور با موفقیت تایید شد', 'success')
|
||||
refetch()
|
||||
setShowModal(false)
|
||||
},
|
||||
onError: (error: ErrorType) => {
|
||||
toast.error(error.response?.data?.error.message[0])
|
||||
toast(error?.response?.data?.message || 'خطا در تایید فاکتور', 'error')
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -52,7 +52,7 @@ const ApproveInvoice: FC<Props> = ({ id, refetch, status }) => {
|
||||
reset()
|
||||
},
|
||||
onError: (error: ErrorType) => {
|
||||
toast.error(error.response?.data?.error.message[0])
|
||||
toast(error?.response?.data?.message || 'خطا در تایید فاکتور', 'error')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user