catch 수정 및 불필요 api 삭제 api 변경 내역 수정

This commit is contained in:
focp212@naver.com
2025-11-07 15:16:14 +09:00
parent e5342f1d0a
commit b5db56fd70
63 changed files with 498 additions and 507 deletions

View File

@@ -32,6 +32,7 @@ import {
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
import { checkGrant } from '@/shared/lib/check-grant';
import { showAlert } from '@/widgets/show-alert';
import { snackBar } from '@/shared/lib';
export interface AllTransactionDetailProps {
detailOn: boolean;
@@ -79,7 +80,7 @@ export const AllTransactionDetail = ({
setPartCancelInfo(rs.partCancelInfo);
}).catch((e: any) => {
if(e.response?.data?.error?.message){
showAlert(e.response?.data?.error?.message);
snackBar(e.response?.data?.error?.message);
return;
}
});

View File

@@ -14,6 +14,7 @@ import { NumericFormat } from 'react-number-format';
import { DetailMotionDuration, DetailMotionStyle, DetailMotionVariants } from '@/entities/common/model/constant';
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
import { showAlert } from '@/widgets/show-alert';
import { snackBar } from '@/shared/lib';
export interface BillingDetailProps {
detailOn: boolean;
@@ -45,7 +46,7 @@ export const BillingDetail = ({
})
}).catch((e: any) => {
if(e.response?.data?.error?.message){
showAlert(e.response?.data?.error?.message);
snackBar(e.response?.data?.error?.message);
return;
}
});

View File

@@ -71,7 +71,7 @@ export const CashReceiptDetail = ({
}, 2000);
}).catch((e: any) => {
if(e.response?.data?.error?.message){
showAlert(e.response?.data?.error?.message);
snackBar(e.response?.data?.error?.message);
return;
}
});
@@ -94,7 +94,7 @@ export const CashReceiptDetail = ({
}
}).catch((e: any) => {
if(e.response?.data?.error?.message){
showAlert(e.response?.data?.error?.message);
snackBar(e.response?.data?.error?.message);
return;
}
});

View File

@@ -29,6 +29,7 @@ import { DetailMotionDuration, DetailMotionStyle, DetailMotionVariants } from '@
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
import { checkGrant } from '@/shared/lib/check-grant';
import { showAlert } from '@/widgets/show-alert';
import { snackBar } from '@/shared/lib';
export interface EscrowDetailProps {
detailOn: boolean;
@@ -87,7 +88,7 @@ export const EscrowDetail = ({
setOrderNumber(rs.importantInfo?.orderNumber);
}).catch((e: any) => {
if(e.response?.data?.error?.message){
showAlert(e.response?.data?.error?.message);
snackBar(e.response?.data?.error?.message);
return;
}
});
@@ -117,7 +118,7 @@ export const EscrowDetail = ({
console.log(rs);
}).catch((e: any) => {
if(e.response?.data?.error?.message){
showAlert(e.response?.data?.error?.message);
snackBar(e.response?.data?.error?.message);
return;
}
});

View File

@@ -1,12 +1,12 @@
import moment from 'moment';
import { useTranslation } from 'react-i18next';
import { SectionTitleArrow } from '@/entities/common/ui/section-title-arrow';
import { useDownloadConfirmationMutation } from '../../api/use-download-confirmation-mutation';
import { InfoSectionKeys, InfoSectionProps, TransactionCategory } from '../../model/types';
import { CashReceiptReceiptDownloadParams, CashReceiptReceiptDownloadResponse, InfoSectionKeys, InfoSectionProps, TransactionCategory } from '../../model/types';
import { SlideDown } from 'react-slidedown';
import 'react-slidedown/lib/slidedown.css';
import { showAlert } from '@/widgets/show-alert';
import { snackBar } from '@/shared/lib';
import { useCashReceiptReceiptDownloadMutation } from '../../api/use-cash-receipt-receipt-download-mutation';
export const AmountInfoSection = ({
transactionCategory,
@@ -18,7 +18,9 @@ export const AmountInfoSection = ({
canDownloadReceipt
}: InfoSectionProps) => {
const { t } = useTranslation();
const { mutateAsync: downloadConfirmation } = useDownloadConfirmationMutation();
const { mutateAsync: cashReceiptReceiptDownload } = useCashReceiptReceiptDownloadMutation();
let newAmountInfo: Record<string, any> | undefined = amountInfo;
const subItems: Record<string, Record<string, string>> = {
mid: {name: t('transaction.fields.mid'), type: 'string'},
@@ -182,15 +184,17 @@ export const AmountInfoSection = ({
}
};
const onClickToDownloadConfirmation = () => {
const onClickToDownload = () => {
if(!!tid){
downloadConfirmation({
let params: CashReceiptReceiptDownloadParams = {
tid: tid
}).then((rs) => {
};
cashReceiptReceiptDownload(params).then((rs: CashReceiptReceiptDownloadResponse) => {
console.log(rs);
snackBar('거래확인서 다운 성공');
}).catch((e: any) => {
if(e.response?.data?.error?.message){
showAlert(e.response?.data?.error?.message);
snackBar(e.response?.data?.error?.message);
return;
}
});
@@ -395,7 +399,7 @@ export const AmountInfoSection = ({
<button
className="doc-btn"
type="button"
onClick={ () => onClickToDownloadConfirmation() }
onClick={ () => onClickToDownload() }
>{t('transaction.fields.transactionConfirmation')}</button>
}
</div>