|
|
|
|
@ -6,10 +6,11 @@ import { |
|
|
|
|
|
|
|
|
|
import { isValidEmail } from 'features/AuthServiceApp/helpers/isValidEmail' |
|
|
|
|
import { loginCheckChangePass } from 'features/AuthServiceApp/requests/loginCheck' |
|
|
|
|
import { useLexicsStore } from 'features/LexicsStore' |
|
|
|
|
|
|
|
|
|
import { useParamsUrl } from '../../hooks/useParamsUrl' |
|
|
|
|
|
|
|
|
|
export const useRecovery = (setIsModalOpen: (value: boolean) => void) => { |
|
|
|
|
const { lang } = useLexicsStore() |
|
|
|
|
const { client_id, lang } = useParamsUrl() |
|
|
|
|
const [isSendBtnDisabled, setIsSendBtnDisabled] = useState(true) |
|
|
|
|
const [error, setError] = useState('') |
|
|
|
|
const [email, setEmail] = useState('') |
|
|
|
|
@ -46,7 +47,11 @@ export const useRecovery = (setIsModalOpen: (value: boolean) => void) => { |
|
|
|
|
|
|
|
|
|
const handleSubmit = () => { |
|
|
|
|
setIsFetching(true) |
|
|
|
|
loginCheckChangePass(email, lang) |
|
|
|
|
loginCheckChangePass( |
|
|
|
|
client_id, |
|
|
|
|
email, |
|
|
|
|
lang, |
|
|
|
|
) |
|
|
|
|
.then(() => { |
|
|
|
|
setIsFetching(false) |
|
|
|
|
setIsSendMessage(true) |
|
|
|
|
|