diff --git a/ssh-web/src/pages/Account/Child/index.tsx b/ssh-web/src/pages/Account/Child/index.tsx index c184aa7..5bf247f 100644 --- a/ssh-web/src/pages/Account/Child/index.tsx +++ b/ssh-web/src/pages/Account/Child/index.tsx @@ -21,6 +21,7 @@ interface DepositAccountCardProps { handleDeleteAccountModal: ( item: ICommonAccount | ISavingAccount | IDepositAccount | null, ) => void; + setIsOpen: React.Dispatch>; } interface InstallmentAccountCardProps { @@ -177,6 +178,30 @@ export const Account = () => { setSelectedAccount(account); }; + interface submitSendMoneyProps { + amount: string; + accountNumber: string; + memo: string; + } + + const submitSendMoney = ({ + amount, + accountNumber, + memo, + }: submitSendMoneyProps) => { + setIsOpen(false); + api + .post(`/api/accounts/transfer`, { + transactionBalance: amount, + depositAccountNo: accountNumber, + transactionSummary: memo, + }) + .then((response) => { + showToast('success', '송금이 성공적으로 완료되었습니다.'); + }) + .catch((error: Error) => {}); + }; + const ReturnTypeModal = () => { switch (modalType) { case 'SEND': @@ -224,6 +249,7 @@ export const Account = () => { handleSendMoney={handleSendMoneyModal} handleAccountLogModal={handleAccountLogModal} handleDeleteAccountModal={handleDeleteAccountModal} + setIsOpen={setIsOpen} /> ); } else if (item?.accountType === '3') { @@ -314,6 +340,7 @@ export const DepositAccountCard = ({ handleSendMoney, handleAccountLogModal, handleDeleteAccountModal, + setIsOpen, }: DepositAccountCardProps) => { return (
@@ -521,20 +548,9 @@ export const SendMoneyModal = ({ account, setIsOpen }: SendMoneyModalProps) => { size="xl" fullWidth={true} variant="standard" - state={amountState} - onChange={handleAmountChange} + onChange={handlMemoChange} /> -
- - (원) - -
- {errors.amount && ( - - {errors.amount} - - )}