diff --git a/src/entities/transaction/model/types.ts b/src/entities/transaction/model/types.ts index 400d758..62f18ba 100644 --- a/src/entities/transaction/model/types.ts +++ b/src/entities/transaction/model/types.ts @@ -771,6 +771,7 @@ export interface CashReceiptPurposeUpdateResponse { updateDateTime: string; }; export interface CashReceiptManualIssueParams { + mid: string; businessNumber: string, purpose: CashReceiptPurposeType productName: string, diff --git a/src/pages/support/faq/detail-page.tsx b/src/pages/support/faq/detail-page.tsx deleted file mode 100644 index e1c476b..0000000 --- a/src/pages/support/faq/detail-page.tsx +++ /dev/null @@ -1,56 +0,0 @@ -import { useEffect, useState } from 'react'; -import { PATHS } from '@/shared/constants/paths'; -import { useLocation } from 'react-router'; -import { useNavigate } from '@/shared/lib/hooks/use-navigate'; -import { HeaderType } from '@/entities/common/model/types'; -import { useTranslation } from 'react-i18next'; -import { - useSetHeaderTitle, - useSetHeaderType, - useSetFooterMode, - useSetOnBack -} from '@/widgets/sub-layout/use-sub-layout'; - -export const FaqDetailPage = () => { - const { navigate } = useNavigate(); - const location = useLocation(); - const { t } = useTranslation(); - - const [cursorId, setCursorId] = useState(0); - const [seq, setSeq] = useState(''); - const [category, setCategory] = useState(''); - const [title, setTitle] = useState(''); - const [contents, setContents] = useState(''); - - useSetHeaderTitle(t('support.faq.title')); - useSetHeaderType(HeaderType.LeftArrow); - useSetFooterMode(false); - useSetOnBack(() => { - navigate(PATHS.support.faq.list); - }); - - useEffect(() => { - setCursorId(location?.state.cursorId); - setSeq(location?.state.seq); - setCategory(location?.state.category); - setTitle(location?.state.title); - setContents(location?.state.contents); - }, []); - return ( - <> -
- { contents && -
-
-
-
{ title }
-
-
-
-
-
- } -
- - ); -}; \ No newline at end of file diff --git a/src/pages/support/faq/list-page.tsx b/src/pages/support/faq/list-page.tsx index 94faee0..ce3ab13 100644 --- a/src/pages/support/faq/list-page.tsx +++ b/src/pages/support/faq/list-page.tsx @@ -15,6 +15,7 @@ import { } from '@/widgets/sub-layout/use-sub-layout'; import useIntersectionObserver from '@/widgets/intersection-observer'; import { FaqDetail } from '@/entities/support/ui/detail/faq-detail'; +import { showAlert } from '@/widgets/show-alert'; export const FaqListPage = () => { const { navigate } = useNavigate(); @@ -95,6 +96,11 @@ export const FaqListPage = () => { && 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; + } }); }; diff --git a/src/pages/support/notice/detail-page.tsx b/src/pages/support/notice/detail-page.tsx deleted file mode 100644 index 93a4253..0000000 --- a/src/pages/support/notice/detail-page.tsx +++ /dev/null @@ -1,73 +0,0 @@ -import { useEffect, useState } from 'react'; -import { useLocation } from 'react-router'; -import { useTranslation } from 'react-i18next'; -import { PATHS } from '@/shared/constants/paths'; -import { useNoticeDetailMutation } from '@/entities/support/api/use-notice-detail-mutation'; -import { useNavigate } from '@/shared/lib/hooks/use-navigate'; -import { HeaderType } from '@/entities/common/model/types'; -import { NoticeDetailParams, NoticeDetailResponse, NoticeItem } from '@/entities/support/model/types'; -import { - useSetHeaderTitle, - useSetHeaderType, - useSetFooterMode, - useSetOnBack -} from '@/widgets/sub-layout/use-sub-layout'; -import moment from 'moment'; - -export const NoticeDetailPage = () => { - const { navigate } = useNavigate(); - const location = useLocation(); - const { t } = useTranslation(); - - const [result, setResult] = useState({}); - - let from = location?.state.from; - - useSetHeaderTitle(t('support.notice.title')); - useSetHeaderType(HeaderType.RightClose); - useSetFooterMode(false); - useSetOnBack(() => { - if(from){ - navigate(from); - } - else{ - navigate(PATHS.support.notice.list); - } - }); - - const { mutateAsync: noticeDetail } = useNoticeDetailMutation(); - - const callDetail = () => { - let detailParams: NoticeDetailParams = { - seq: location?.state.seq, - }; - noticeDetail(detailParams).then((rs: NoticeDetailResponse) => { - setResult(rs); - }); - }; - - useEffect(() => { - callDetail(); - }, []); - - return ( - <> -
- { result.informCl && -
-
-
-
-
{ result.title }
-
{ moment(result.regDt).format('YYYY.MM.DD') } | { t(`support.notice.categories.${result.informCl}`) }
-
-
-
-
-
-
- } -
- - ); -}; \ No newline at end of file diff --git a/src/pages/support/notice/list-page.tsx b/src/pages/support/notice/list-page.tsx index b1436ce..4de1e9a 100644 --- a/src/pages/support/notice/list-page.tsx +++ b/src/pages/support/notice/list-page.tsx @@ -16,6 +16,7 @@ import { import useIntersectionObserver from '@/widgets/intersection-observer'; import { NoticeDetail } from '@/entities/support/ui/detail/notice-detail'; import { useParams } from 'react-router'; +import { showAlert } from '@/widgets/show-alert'; export const NoticeListPage = () => { const { navigate } = useNavigate(); @@ -97,8 +98,13 @@ export const NoticeListPage = () => { && 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; + } }); - }; +}; const onClickToAction = () => { // Remove focus from active element diff --git a/src/pages/support/qna/detail-page.tsx b/src/pages/support/qna/detail-page.tsx deleted file mode 100644 index 7d294af..0000000 --- a/src/pages/support/qna/detail-page.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import moment from 'moment'; -import { useEffect, useState } from 'react'; -import { PATHS } from '@/shared/constants/paths'; -import { useLocation } from 'react-router'; -import { useNavigate } from '@/shared/lib/hooks/use-navigate'; -import { HeaderType } from '@/entities/common/model/types'; -import { - useSetHeaderTitle, - useSetHeaderType, - useSetFooterMode, - useSetOnBack -} from '@/widgets/sub-layout/use-sub-layout'; -import { useTranslation } from 'react-i18next'; - -export const QnaDetailPage = () => { - const { navigate } = useNavigate(); - const { t } = useTranslation(); - const location = useLocation(); - - const [answer, setAnswer] = useState(''); - const [answerDate, setAnswerDate] = useState(''); - const [contents, setContents] = useState(''); - const [corpName, setCorpName] = useState(''); - const [cursorId, setCursorId] = useState(0); - const [requestDate, setRequestDate] = useState(''); - const [requestName, setRequestName] = useState(''); - const [requestType, setRequestType] = useState(''); - const [sendEmail, setSendEmail] = useState(''); - const [seq, setSeq] = useState(''); - const [statusCode, setStatusCode] = useState(''); - const [title, setTitle] = useState(''); - - useSetHeaderTitle(t('support.qna.title')); - useSetHeaderType(HeaderType.LeftArrow); - useSetFooterMode(false); - useSetOnBack(() => { - navigate(PATHS.support.qna.list); - }); - - useEffect(() => { - setAnswer(location?.state.answer); - setAnswerDate(location?.state.answerDate); - setContents(location?.state.contents); - setCorpName(location?.state.corpName); - setCursorId(location?.state.cursorId); - setRequestDate(location?.state.requestDate); - setRequestName(location?.state.requestName); - setRequestType(location?.state.requestType); - setSendEmail(location?.state.sendEmail); - setSeq(location?.state.seq); - setStatusCode(location?.state.statusCode); - setTitle(location?.state.title); - }, []); - - return ( - <> -
- { statusCode && -
-
-
-
-
- {t('support.qna.detailLabels.title')} - { title } -
-
- {t('support.qna.detailLabels.type')} - { t(`support.qna.categories.${requestType}`) } -
-
- {t('support.qna.detailLabels.registrationDate')} - { !!requestDate? moment(requestDate).format('YYYY.MM.DD'): '' } -
-
- {t('support.qna.detailLabels.answerDate')} - { !!answerDate? moment(answerDate).format('YYYY.MM.DD'): '' } -
-
-
-
-
{t('support.qna.detailLabels.inquiryAnswer')}
-
-
-
-
{t('support.qna.detailLabels.inquiryContents')}
-
-
-
-
-
- } -
- - ); -}; \ No newline at end of file diff --git a/src/pages/support/qna/list-page.tsx b/src/pages/support/qna/list-page.tsx index cd0b4a1..bc15d38 100644 --- a/src/pages/support/qna/list-page.tsx +++ b/src/pages/support/qna/list-page.tsx @@ -109,6 +109,11 @@ export const QnaListPage = () => { && 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; + } }); }; diff --git a/src/pages/support/qna/register-page.tsx b/src/pages/support/qna/register-page.tsx index b43ed4b..b0374e0 100644 --- a/src/pages/support/qna/register-page.tsx +++ b/src/pages/support/qna/register-page.tsx @@ -139,6 +139,11 @@ export const QnaRegisterPage = () => { qnaSave(params).then((rs: QnaSaveResponse) => { alert(t('support.qna.successMessage')); navigate(PATHS.support.qna.list); + }).catch((e: any) => { + if(e.response?.data?.error?.message){ + showAlert(e.response?.data?.error?.message); + return; + } }); }; diff --git a/src/pages/transaction/all-transaction/cancel-page.tsx b/src/pages/transaction/all-transaction/cancel-page.tsx index f664609..ad18c07 100644 --- a/src/pages/transaction/all-transaction/cancel-page.tsx +++ b/src/pages/transaction/all-transaction/cancel-page.tsx @@ -23,6 +23,7 @@ import { useStore } from '@/shared/model/store'; import { AllTransactionCancelPreventBond } from '@/entities/transaction/ui/all-transaction-cancel-prevent-bond'; import { snackBar } from '@/shared/lib'; import { useTranslation } from 'react-i18next'; +import { showAlert } from '@/widgets/show-alert'; export const AllTransactionCancelPage = () => { const { t } = useTranslation(); @@ -111,6 +112,11 @@ export const AllTransactionCancelPage = () => { // debtPreventionCancelDisplayInfo.isCancel == false => 얼럿만 띄우고 취소요청하면안됨 + }).catch((e: any) => { + if(e.response?.data?.error?.message){ + showAlert(e.response?.data?.error?.message); + return; + } }); }; @@ -140,6 +146,10 @@ export const AllTransactionCancelPage = () => { setRequestSuccess(true); }).catch((e: any) => { setRequestSuccess(false); + if(e.response?.data?.error?.message){ + showAlert(e.response?.data?.error?.message); + return; + } }); } diff --git a/src/pages/transaction/all-transaction/list-page.tsx b/src/pages/transaction/all-transaction/list-page.tsx index 0e7e00a..de4b150 100644 --- a/src/pages/transaction/all-transaction/list-page.tsx +++ b/src/pages/transaction/all-transaction/list-page.tsx @@ -165,10 +165,21 @@ export const AllTransactionListPage = () => { && 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; + } }); + allTransactionListSummary(listSummaryParams).then((rs: AllTransactionListSummaryResponse) => { setTotalAmount(rs.totalAmount); setTotalCount(rs.totalCount); + }).catch((e: any) => { + if(e.response?.data?.error?.message){ + showAlert(e.response?.data?.error?.message); + return; + } }); }; diff --git a/src/pages/transaction/billing/charge-page.tsx b/src/pages/transaction/billing/charge-page.tsx index af95f13..12e4972 100644 --- a/src/pages/transaction/billing/charge-page.tsx +++ b/src/pages/transaction/billing/charge-page.tsx @@ -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; diff --git a/src/pages/transaction/billing/list-page.tsx b/src/pages/transaction/billing/list-page.tsx index 5fa2565..ac96561 100644 --- a/src/pages/transaction/billing/list-page.tsx +++ b/src/pages/transaction/billing/list-page.tsx @@ -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; + } }); } diff --git a/src/pages/transaction/cash-receipt/hand-written-issuance-page.tsx b/src/pages/transaction/cash-receipt/hand-written-issuance-page.tsx index 2f481a0..2133663 100644 --- a/src/pages/transaction/cash-receipt/hand-written-issuance-page.tsx +++ b/src/pages/transaction/cash-receipt/hand-written-issuance-page.tsx @@ -4,7 +4,7 @@ import { PATHS } from '@/shared/constants/paths'; import { useNavigate } from '@/shared/lib/hooks/use-navigate'; import { CashReceiptHandWrittenIssuanceStep1 } from '@/entities/transaction/ui/cash-receipt-hand-written-issuance-step1'; import { CashReceiptHandWrittenIssuanceStep2 } from '@/entities/transaction/ui/cash-receipt-hand-written-issuance-step2'; -import { CashReceiptPurposeType, ProcessStep } from '@/entities/transaction/model/types'; +import { CashReceiptManualIssueParams, CashReceiptManualIssueResponse, CashReceiptPurposeType, ProcessStep } from '@/entities/transaction/model/types'; import { HeaderType} from '@/entities/common/model/types'; import { useSetFooterMode, useSetHeaderTitle, useSetHeaderType } from '@/widgets/sub-layout/use-sub-layout'; import { useCashReceiptManualIssueMutation } from '@/entities/transaction/api/use-cash-receipt-manual-issue-mutation'; @@ -49,7 +49,7 @@ export const CashReceitHandWrittenIssuancePage = () => { }; const callManualIssue = () => { - let params = { + let params: CashReceiptManualIssueParams = { mid: userMid, businessNumber: businessNumber, purpose: purposeType, @@ -63,11 +63,15 @@ export const CashReceitHandWrittenIssuancePage = () => { taxFreeAmount: taxFreeAmount, serviceCharge: serviceCharge }; - cashReceiptManualIssue(params).then((rs) => { - console.log(rs); + cashReceiptManualIssue(params).then((rs: CashReceiptManualIssueResponse) => { snackBar('수기 신청이 완료되었습니다.', function(){ navigate(PATHS.transaction.cashReceipt.list); }, 3000); + }).catch((e: any) => { + if(e.response?.data?.error?.message){ + showAlert(e.response?.data?.error?.message); + return; + } }); }; diff --git a/src/pages/transaction/cash-receipt/list-page.tsx b/src/pages/transaction/cash-receipt/list-page.tsx index 1a57d02..3ce2f19 100644 --- a/src/pages/transaction/cash-receipt/list-page.tsx +++ b/src/pages/transaction/cash-receipt/list-page.tsx @@ -151,14 +151,25 @@ export const CashReceiptListPage = () => { && 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; + } + }); + cashReceiptSummary(listSummaryParams).then((rs: CashReceiptSummaryResponse) => { setApprovalCount(rs.approvalCount); setApprovalAmount(rs.approvalAmount); setCancelCount(rs.cancelCount); setCancelAmount(rs.cancelAmount); setTotalCount(rs.totalCount); - }); + }).catch((e: any) => { + if(e.response?.data?.error?.message){ + showAlert(e.response?.data?.error?.message); + return; + } + }); } diff --git a/src/pages/transaction/escrow/list-page.tsx b/src/pages/transaction/escrow/list-page.tsx index 08e0a16..eaa1da4 100644 --- a/src/pages/transaction/escrow/list-page.tsx +++ b/src/pages/transaction/escrow/list-page.tsx @@ -141,6 +141,11 @@ export const EscrowListPage = () => { && 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; + } }); };