Переписываю спорные решения

This commit is contained in:
2023-01-13 13:02:48 +03:00
parent 1234427b12
commit 75de4983c9
44 changed files with 875 additions and 39786 deletions

View File

@ -1,7 +1,7 @@
import React, { useState } from 'react'
import { fetchPost } from '../../server/server'
import { auth } from '../../redux/outstaffingSlice'
import { useHistory, useParams, Redirect } from 'react-router-dom'
import {useParams, useNavigate} from 'react-router-dom'
import { Loader } from '../Loader/Loader'
import PhoneInput from 'react-phone-input-2'
import 'react-phone-input-2/lib/style.css'
@ -16,7 +16,7 @@ const SweetAlert = withSwalInstance(swal)
const Form = () => {
const dispatch = useDispatch()
const history = useHistory()
const navigate = useNavigate()
const role = useSelector(getRole)
const urlParams = useParams()
const [status, setStatus] = useState(null)
@ -52,7 +52,7 @@ const Form = () => {
profile_id: urlParams.id,
...data
},
history,
role,
logout: () => dispatch(auth(false))
}).then((res) =>
@ -79,8 +79,8 @@ const Form = () => {
setStatus(null)
}
: () => {
setStatus(null)
history.push(`/candidate/${urlParams.id}`)
setStatus(null);
navigate(`/candidate/${urlParams.id}`)
}
}
/>