toast
This commit is contained in:
@@ -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')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user