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