catch
This commit is contained in:
@@ -16,6 +16,7 @@ import { showAlert } from '@/widgets/show-alert';
|
||||
import moment from 'moment';
|
||||
import NiceCalendar from '@/shared/ui/calendar/nice-calendar';
|
||||
import { notiBar, snackBar } from '@/shared/lib';
|
||||
import { BillingChargeParams, BillingChargeResponse } from '@/entities/transaction/model/types';
|
||||
|
||||
export const BillingChargePage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
@@ -70,7 +71,7 @@ export const BillingChargePage = () => {
|
||||
showAlert('구매자명은 필수 입력 항목입니다.');
|
||||
}
|
||||
|
||||
let params = {
|
||||
let params: BillingChargeParams = {
|
||||
billKey: billKey,
|
||||
productName: productName,
|
||||
productAmount: productAmount,
|
||||
@@ -79,13 +80,12 @@ export const BillingChargePage = () => {
|
||||
paymentRequestDate: moment(paymentRequestDate).format('YYYYMMDD'),
|
||||
installmentMonth: installmentMonth
|
||||
};
|
||||
billingCharge(params).then((rs) => {
|
||||
billingCharge(params).then((rs: BillingChargeResponse) => {
|
||||
snackBar('결제 신청을 성공하였습니다.', function(){
|
||||
navigate(PATHS.transaction.billing.list);
|
||||
}, 3000);
|
||||
|
||||
}).catch((e: any) => {
|
||||
console.log(e)
|
||||
if(e.response?.data?.error?.message){
|
||||
showAlert(e.response?.data?.error?.message);
|
||||
return;
|
||||
|
||||
@@ -141,6 +141,11 @@ export const BillingListPage = () => {
|
||||
&& rs.nextCursor !== pageParam.cursor
|
||||
&& rs.content.length === DEFAULT_PAGE_PARAM.size
|
||||
);
|
||||
}).catch((e: any) => {
|
||||
if(e.response?.data?.error?.message){
|
||||
showAlert(e.response?.data?.error?.message);
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user