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

@@ -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>