This commit is contained in:
hamid zarghami
2025-05-03 11:58:06 +03:30
parent 9a2ea35918
commit 551dfa0a56
20 changed files with 124 additions and 66 deletions
+3 -3
View File
@@ -11,7 +11,7 @@ import { useTranslation } from 'react-i18next'
import { useFormik } from 'formik'
import * as Yup from 'yup'
import { BuyServiceType } from './types/ServiecTypes'
import { toast } from 'react-toastify'
import { toast } from '../../components/Toast'
import { ErrorType } from '../../helpers/types'
import { Pages } from '../../config/Pages'
@@ -40,11 +40,11 @@ const BuyService: FC = () => {
onSubmit: (values) => {
buyService.mutate(values, {
onSuccess: (data) => {
toast.success(t('success'))
toast(t('success'), 'success')
navigate(Pages.receipts.detail + data?.data?.invoice?.id)
},
onError: (error: ErrorType) => {
toast.error(error.response?.data?.error.message[0])
toast(error.response?.data?.error?.message[0], 'error')
}
})
}