This commit is contained in:
@@ -3,7 +3,7 @@ import Button from '../../../components/Button'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { useRejectTransfer } from '../hooks/usePaymentData'
|
||||
import ModalConfrim from '../../../components/ModalConfrim'
|
||||
import { toast } from 'react-toastify'
|
||||
import { toast } from '../../../components/Toast';
|
||||
import { ErrorType } from '../../../helpers/types'
|
||||
|
||||
type Props = {
|
||||
@@ -20,16 +20,16 @@ const Reject: FC<Props> = (props: Props) => {
|
||||
if (text && text.length > 0) {
|
||||
rejectTransfer.mutate({ id: props.id, comment: text }, {
|
||||
onSuccess: () => {
|
||||
toast.success(t('success'))
|
||||
toast(t('success'), 'success')
|
||||
setOpenConfrimModal(false)
|
||||
window.location.reload()
|
||||
},
|
||||
onError(error: ErrorType) {
|
||||
toast.error(error?.response?.data?.error?.message[0])
|
||||
toast(error?.response?.data?.error?.message[0], 'error')
|
||||
},
|
||||
})
|
||||
} else {
|
||||
toast.error(t('payment.reject_comment_error'))
|
||||
toast(t('payment.reject_comment_error'), 'error')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user