navihate
This commit is contained in:
@@ -78,7 +78,10 @@ const Confirm = () => {
|
||||
mutationFn: (payload: otpPayload) => authApi.verifyOtp(payload),
|
||||
onSuccess: async res => {
|
||||
await AsyncStorage.setItem('token', res.data.accessToken);
|
||||
navigation.navigate('Home');
|
||||
navigation.reset({
|
||||
index: 0,
|
||||
routes: [{ name: 'Home' }], // login sahifasiga qaytarish
|
||||
});
|
||||
setVisible(false);
|
||||
},
|
||||
onError: (err: any) => {
|
||||
|
||||
@@ -13,7 +13,6 @@ import AppText from 'components/AppText';
|
||||
import DatePickerInput from 'components/DatePicker';
|
||||
import ErrorNotification from 'components/ErrorNotification';
|
||||
import SingleFileDrop from 'components/FileDrop';
|
||||
import { saveAuth } from 'helpers/event';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { Controller, useForm } from 'react-hook-form';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -80,8 +79,10 @@ const SecondStep = () => {
|
||||
mutationFn: (payload: sendPassportPayload) =>
|
||||
passportApi.sendPassport(payload),
|
||||
onSuccess: res => {
|
||||
navigation.replace('Home');
|
||||
saveAuth();
|
||||
navigation.reset({
|
||||
index: 0,
|
||||
routes: [{ name: 'Home' }],
|
||||
});
|
||||
},
|
||||
onError: (err: any) => {
|
||||
setError(err?.response?.data || 'Xatolik yuz berdi');
|
||||
|
||||
Reference in New Issue
Block a user