This repository was archived by the owner on Apr 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed
web/src/layouts/bank/pages/accounts/modals Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 161161 "no_balance" : " No balance" ,
162162 "no_access" : " No access" ,
163163 "something_went_wrong" : " Unknown error, something went wrong" ,
164- "account_id_not_exists" : " No account with such id found"
164+ "account_id_not_exists" : " No account with such id found" ,
165+ "same_account_transfer" : " Cannot transfer money to the same account"
165166}
Original file line number Diff line number Diff line change @@ -137,6 +137,7 @@ onClientCallback(
137137
138138 if ( ! hasPermission ) return ;
139139
140+ target = typeof ( target ) == "string" ? Number . parseInt ( target ) : target
140141 let targetAccountId = 0 ;
141142
142143 try {
Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ const TransferModal: React.FC<{ account: Account }> = ({ account }) => {
6464 message : locales . amount_greater_than_balance ,
6565 } ) ;
6666
67+ if ( values . transferType == 'account' && account . id == values . target )
68+ return form . setError ( 'target' , {
69+ type : 'value' ,
70+ message : locales . same_account_transfer
71+ } )
72+
6773 setIsLoading ( true ) ;
6874 const resp = await fetchNui < { success : boolean ; message ?: string } > (
6975 'transferMoney' ,
You can’t perform that action at this time.
0 commit comments