Commit da1c0218 by Giang Tran

edit moment

parent 6be9c092
...@@ -5,7 +5,7 @@ import {showAlert, TYPE} from '../../../components/DropdownAlert'; ...@@ -5,7 +5,7 @@ import {showAlert, TYPE} from '../../../components/DropdownAlert';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {hideLoading, showLoading} from '../../../actions/loadingAction'; import {hideLoading, showLoading} from '../../../actions/loadingAction';
import I18n from '../../../helper/i18/i18n'; import I18n from '../../../helper/i18/i18n';
import {SMARTOTPCONFIG} from '../../../routers/ScreenNames'; import {SMARTOTPCONFIG, TABNAVIGATOR} from '../../../routers/ScreenNames';
import {useNavigation} from '@react-navigation/native'; import {useNavigation} from '@react-navigation/native';
const ConfirmChangeSmartOTP = (props) => { const ConfirmChangeSmartOTP = (props) => {
...@@ -33,17 +33,23 @@ const ConfirmChangeSmartOTP = (props) => { ...@@ -33,17 +33,23 @@ const ConfirmChangeSmartOTP = (props) => {
const onCheckPINSmartOTPPin = async () => { const onCheckPINSmartOTPPin = async () => {
let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`; let pinCode = `${firstNumber}${secondsNumber}${thirdNumber}${fourNumber}`;
props.showLoading();
const res = await updateOTPApiSmart({ const res = await updateOTPApiSmart({
platform: Platform.OS, platform: Platform.OS,
password: props.route.params.pre_otp, password: props.route.params.pre_otp,
password_confirmation: pinCode, password_confirmation: pinCode,
old_password: props.route.params.old_password, old_password: props.route.params.old_password,
}); });
props.hideLoading();
if (res.data.code == 200) { if (res.data.code == 200) {
showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message); showAlert(TYPE.SUCCESS, I18n.t('Notification'), res.data.message);
setFirstNumber(null);
setSecondsNumber(null);
setThirdNumber(null);
setFourNumber(null);
navigation.reset({ navigation.reset({
index: 1, index: 1,
routes: [{name: SMARTOTPCONFIG}], routes: [{name: TABNAVIGATOR}, {name: SMARTOTPCONFIG}],
}); });
} else { } else {
showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message); showAlert(TYPE.ERROR, I18n.t('Notification'), res.data.message);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment