fix bug toast and do not change slug id

This commit is contained in:
hamid zarghami
2025-05-21 16:12:38 +03:30
parent 836c1168b2
commit 495e59bec4
9 changed files with 54 additions and 28 deletions
@@ -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')
}
})
}