- 자금이체, 지급대행 입금확인서 BottomSheet useDownloadBottomSheetOn2Store 추가
This commit is contained in:
@@ -213,7 +213,16 @@ export interface ExtensionFundAccountBalanceParams {
|
||||
mid: string;
|
||||
};
|
||||
export interface ExtensionFundAccountBalanceResponse {
|
||||
balance: number;
|
||||
status: boolean;
|
||||
error?: {
|
||||
root? : string;
|
||||
errorKey?: string;
|
||||
message?: string;
|
||||
}
|
||||
data?: {
|
||||
balance?: number;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// 입금확인증 다운로드
|
||||
|
||||
@@ -17,6 +17,7 @@ import { showAlert } from '@/widgets/show-alert';
|
||||
import { snackBar } from '@/shared/lib';
|
||||
import { DepositReceiptSample } from '@/entities/common/ui/deposit-receipt-sample';
|
||||
import { DepositInfo } from '@/entities/transaction/model/types';
|
||||
import { useDownloadBottomSheetOn2Store } from '@/shared/model/store';
|
||||
|
||||
export interface FundAccountResultDetailProps {
|
||||
detailOn: boolean;
|
||||
@@ -31,10 +32,9 @@ export const FundAccountResultDetail = ({
|
||||
tid
|
||||
}: FundAccountResultDetailProps) => {
|
||||
const { t } = useTranslation();
|
||||
const { downloadBottomSheetOn2, setDownloadBottomSheetOn2 } = useDownloadBottomSheetOn2Store();
|
||||
|
||||
const [detail, setDetail] = useState<ExtensionFundAccountResultDetailResponse>();
|
||||
|
||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
||||
const [depositReceiptSampleOn, setDepositReceiptSampleOn] = useState<boolean>(false);
|
||||
const { mutateAsync: extensionFundAccountResultDetail } = useExtensionFundAccountResultDetailMutation();
|
||||
const { mutateAsync: extensionFundAccountDownlaodReceipt } = useExtensionFundAccountDownloadReceiptMutation();
|
||||
@@ -57,7 +57,7 @@ export const FundAccountResultDetail = ({
|
||||
};
|
||||
|
||||
const onClickToOpenDownloadBottomSheet = () => {
|
||||
setDownloadBottomSheetOn(true);
|
||||
setDownloadBottomSheetOn2(true);
|
||||
};
|
||||
|
||||
const onRequestDownload = (
|
||||
@@ -200,10 +200,10 @@ export const FundAccountResultDetail = ({
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{!!downloadBottomSheetOn &&
|
||||
{!!downloadBottomSheetOn2 &&
|
||||
<DownloadBottomSheet
|
||||
bottomSheetOn={downloadBottomSheetOn}
|
||||
setBottomSheetOn={setDownloadBottomSheetOn}
|
||||
bottomSheetOn={downloadBottomSheetOn2}
|
||||
setBottomSheetOn={setDownloadBottomSheetOn2}
|
||||
imageMode={true}
|
||||
emailMode={true}
|
||||
sendRequest={onRequestDownload}
|
||||
|
||||
@@ -194,7 +194,17 @@ export const FundAccountTransferListWrap = () => {
|
||||
mid: mid
|
||||
};
|
||||
extensionFundAccountBalance(params).then((rs: ExtensionFundAccountBalanceResponse) => {
|
||||
setBalance(rs.balance);
|
||||
if (rs.status) {
|
||||
if (!rs.data?.balance) {
|
||||
setBalance(0);
|
||||
} else {
|
||||
setBalance(balance)
|
||||
}
|
||||
} else {
|
||||
const errorMessage = rs.error?.message || t('additionalService.fundAccount.failRequestBalance');
|
||||
setBalance(0);
|
||||
snackBar(errorMessage)
|
||||
}
|
||||
}).catch((e: any) => {
|
||||
if (e.response?.data?.error?.message) {
|
||||
snackBar(e.response?.data?.error?.message);
|
||||
|
||||
@@ -13,6 +13,7 @@ import { checkGrant } from '@/shared/lib/check-grant';
|
||||
import { snackBar } from '@/shared/lib';
|
||||
import { DepositReceiptSample } from '@/entities/common/ui/deposit-receipt-sample';
|
||||
import { DepositInfo } from '@/entities/transaction/model/types';
|
||||
import { useDownloadBottomSheetOn2Store } from '@/shared/model/store';
|
||||
|
||||
export interface PayoutDetailProps {
|
||||
detailOn: boolean;
|
||||
@@ -30,10 +31,9 @@ export const PayoutDetail = ({
|
||||
depositAmount
|
||||
}: PayoutDetailProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { downloadBottomSheetOn2, setDownloadBottomSheetOn2 } = useDownloadBottomSheetOn2Store();
|
||||
const [detail, setDetail] = useState<ExtensionPayoutDetailResponse>();
|
||||
|
||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
||||
const [depositReceiptSampleOn, setDepositReceiptSampleOn] = useState<boolean>(false);
|
||||
const [depositReceiptData, setDepositReceiptData] = useState<ExtensionPayoutDetailDownloadCertificateResponse>();
|
||||
|
||||
@@ -60,7 +60,7 @@ export const PayoutDetail = ({
|
||||
showAlert(t('common.nopermission'));
|
||||
return;
|
||||
}
|
||||
setDownloadBottomSheetOn(true);
|
||||
setDownloadBottomSheetOn2(true);
|
||||
};
|
||||
|
||||
const onRequestDownload = (
|
||||
@@ -208,10 +208,10 @@ export const PayoutDetail = ({
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{!!downloadBottomSheetOn &&
|
||||
{!!downloadBottomSheetOn2 &&
|
||||
<DownloadBottomSheet
|
||||
bottomSheetOn={downloadBottomSheetOn}
|
||||
setBottomSheetOn={setDownloadBottomSheetOn}
|
||||
bottomSheetOn={ downloadBottomSheetOn2 }
|
||||
setBottomSheetOn={ setDownloadBottomSheetOn2 }
|
||||
imageMode={true}
|
||||
emailMode={true}
|
||||
sendRequest={onRequestDownload}
|
||||
|
||||
@@ -1131,6 +1131,7 @@
|
||||
"registrationSuccess": "Transfer registration successful.",
|
||||
"registrationFailed": "Transfer registration failed.",
|
||||
"registrationError": "An error occurred during transfer registration.",
|
||||
"failReqeustBalance": "An error occured during request balance",
|
||||
"register": "Register",
|
||||
"transferDetailTitle": "Fund Transfer Detail",
|
||||
"detailInfo": "Detail Information",
|
||||
|
||||
@@ -1131,6 +1131,7 @@
|
||||
"registrationSuccess": "이체등록을 성공하였습니다.",
|
||||
"registrationFailed": "이체등록이 실패하였습니다.",
|
||||
"registrationError": "이체등록 중 오류가 발생했습니다.",
|
||||
"failReqeustBalance": "잔액을 불러오는데 실패했습니다.",
|
||||
"register": "등록",
|
||||
"transferDetailTitle": "자금이체 상세",
|
||||
"detailInfo": "상세 정보",
|
||||
|
||||
Reference in New Issue
Block a user