This commit is contained in:
@@ -11,7 +11,7 @@ import { CreatePlanType } from './types/SupportTypes'
|
||||
import * as Yup from 'yup'
|
||||
import Select from '../../components/Select'
|
||||
import { useCreateSupport } from './hooks/useSupportData'
|
||||
import { toast } from 'react-toastify'
|
||||
import { toast } from '../../components/Toast';
|
||||
import { ErrorType } from '../../helpers/types'
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import { Pages } from '../../config/Pages'
|
||||
@@ -104,11 +104,11 @@ const CreatePlan: FC = () => {
|
||||
}
|
||||
createSupport.mutate(planData, {
|
||||
onSuccess: () => {
|
||||
toast.success('پلن با موفقیت ساخته شد')
|
||||
toast('پلن با موفقیت ساخته شد', 'success')
|
||||
navigate(Pages.support.list)
|
||||
},
|
||||
onError: (error: ErrorType) => {
|
||||
toast.error(error.response?.data?.error.message[0])
|
||||
toast(error.response?.data?.error.message[0], 'error')
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
@@ -11,7 +11,7 @@ import { CreatePlanType } from './types/SupportTypes'
|
||||
import * as Yup from 'yup'
|
||||
import Select from '../../components/Select'
|
||||
import { useGetPlanById, useUpdateSupport } from './hooks/useSupportData'
|
||||
import { toast } from 'react-toastify'
|
||||
import { toast } from '../../components/Toast';
|
||||
import { ErrorType } from '../../helpers/types'
|
||||
import { useNavigate, useParams } from 'react-router-dom'
|
||||
import { Pages } from '../../config/Pages'
|
||||
@@ -118,11 +118,11 @@ const UpdatePlan: FC = () => {
|
||||
}
|
||||
updateSupport.mutate({ id: id ?? '', data: planData }, {
|
||||
onSuccess: () => {
|
||||
toast.success('پلن با موفقیت ویرایش شد')
|
||||
toast('پلن با موفقیت ویرایش شد', 'success')
|
||||
navigate(Pages.support.list)
|
||||
},
|
||||
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