This commit is contained in:
@@ -10,7 +10,7 @@ import UploadBox from '../../../components/UploadBox'
|
||||
import { useSingleUpload } from '../../service/hooks/useServiceData'
|
||||
import SwitchComponent from '../../../components/Switch'
|
||||
import Button from '../../../components/Button'
|
||||
import { toast } from 'react-toastify'
|
||||
import { toast } from '../../../components/Toast';
|
||||
import { ErrorType } from '../../../helpers/types'
|
||||
interface Props {
|
||||
id: string
|
||||
@@ -42,12 +42,12 @@ const UpdateCategory: FC<Props> = ({ id }) => {
|
||||
}
|
||||
updateBlogCategory.mutateAsync({ id: id, params: values }, {
|
||||
onSuccess: () => {
|
||||
toast.success('دسته بندی با موفقیت ویرایش شد')
|
||||
toast('دسته بندی با موفقیت ویرایش شد', 'success')
|
||||
setIsOpen(false)
|
||||
window.location.reload()
|
||||
},
|
||||
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