catch
This commit is contained in:
@@ -33,6 +33,7 @@ import { usePaymentCardMutation } from '../api/use-payment-card-mutation';
|
||||
import { usePaymentNonCardMutation } from '../api/use-payment-non-card-mutation';
|
||||
import { usePaymentInstallmentMutation } from '../api/use-payment-installment-mutation';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
|
||||
export const InfoWrap = () => {
|
||||
const { t } = useTranslation();
|
||||
@@ -155,6 +156,11 @@ export const InfoWrap = () => {
|
||||
setGeneralTabItems(rs.generalTab.items);
|
||||
setInstallmentTabItems(rs.installmentTab.items);
|
||||
setMoneyPointTabItems(rs.moneyPointTab.items);
|
||||
}).catch((e: any) => {
|
||||
if(e.response?.data?.error?.message){
|
||||
showAlert(e.response?.data?.error?.message);
|
||||
return;
|
||||
}
|
||||
});
|
||||
};
|
||||
const callPaymentNonCard = () => {
|
||||
@@ -171,6 +177,11 @@ export const InfoWrap = () => {
|
||||
setPaymentFees(rs.mobilePaymentData.paymentFees);
|
||||
setCategoryFees(rs.mobilePaymentData.categoryFees);
|
||||
setFeeRate(rs.otherPaymentData.feeRate);
|
||||
}).catch((e: any) => {
|
||||
if(e.response?.data?.error?.message){
|
||||
showAlert(e.response?.data?.error?.message);
|
||||
return;
|
||||
}
|
||||
});
|
||||
};
|
||||
const callPaymentIntallment = () => {
|
||||
@@ -182,6 +193,11 @@ export const InfoWrap = () => {
|
||||
paymentInstallment(params).then((rs: PaymentInstallmentResponse) => {
|
||||
console.log(rs);
|
||||
setInstallmentData(rs.installmentData);
|
||||
}).catch((e: any) => {
|
||||
if(e.response?.data?.error?.message){
|
||||
showAlert(e.response?.data?.error?.message);
|
||||
return;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -202,6 +218,11 @@ export const InfoWrap = () => {
|
||||
if(rs.installmentDetails){
|
||||
setInstallmentDetails(rs.installmentDetails);
|
||||
}
|
||||
}).catch((e: any) => {
|
||||
if(e.response?.data?.error?.message){
|
||||
showAlert(e.response?.data?.error?.message);
|
||||
return;
|
||||
}
|
||||
});
|
||||
};
|
||||
const changeToCardCompany = (cardCompany: string) => {
|
||||
|
||||
@@ -4,6 +4,7 @@ import { NotifyRowKeys, PaymentNotificationDataParams, PaymentNotificationDataRe
|
||||
import { usePaymentNotificationDataMutation } from '../api/use-payment-notification-data-mutation';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { NotifyRow } from './section/notify-row';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
|
||||
export const NotificationDataWrap = () => {
|
||||
const { t } = useTranslation();
|
||||
@@ -37,6 +38,11 @@ export const NotificationDataWrap = () => {
|
||||
setVirtualAccount(rs?.virtualAccount.detail);
|
||||
setMobilePayment(rs?.mobilePayment.detail);
|
||||
setEscrowPayment(rs?.escrowPayment.detail);
|
||||
}).catch((e: any) => {
|
||||
if(e.response?.data?.error?.message){
|
||||
showAlert(e.response?.data?.error?.message);
|
||||
return;
|
||||
}
|
||||
});
|
||||
};
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user