This commit is contained in:
@@ -10,7 +10,7 @@ import { useCreateServiceCategory, useGetCategoryParents, useSingleUpload } from
|
||||
import { CreateServiceCategoryType, ServiceCategoryType } from '../types/ServiceTypes'
|
||||
import * as Yup from 'yup'
|
||||
import { useFormik } from 'formik'
|
||||
import { toast } from 'react-toastify'
|
||||
import { toast } from '../../../components/Toast';
|
||||
import { ErrorType } from '../../../helpers/types'
|
||||
|
||||
const CreateCategory: FC = () => {
|
||||
@@ -33,7 +33,7 @@ const CreateCategory: FC = () => {
|
||||
}),
|
||||
onSubmit: async (values) => {
|
||||
if (!file) {
|
||||
toast.error(t('errors.upload_image'))
|
||||
toast(t('errors.upload_image'), 'error')
|
||||
return
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ const CreateCategory: FC = () => {
|
||||
values.icon = data?.data?.url
|
||||
},
|
||||
onError: (error: ErrorType) => {
|
||||
toast.error(error.response?.data?.error?.message[0])
|
||||
toast(error.response?.data?.error?.message[0], 'error')
|
||||
}
|
||||
})
|
||||
|
||||
@@ -57,10 +57,10 @@ const CreateCategory: FC = () => {
|
||||
onSuccess: () => {
|
||||
formik.resetForm()
|
||||
getCategory.refetch()
|
||||
toast.success(t('success'))
|
||||
toast(t('success'), 'success')
|
||||
},
|
||||
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