fixed family transfer bug
This commit is contained in:
@@ -7,6 +7,8 @@ import * as Yup from "yup";
|
|||||||
import usersService from '../../../../services/UsersService';
|
import usersService from '../../../../services/UsersService';
|
||||||
import LoadingSpinner from '../../../Spinners/LoadingSpinner';
|
import LoadingSpinner from '../../../Spinners/LoadingSpinner';
|
||||||
import { PriceFormatter } from '../../../Helpers/PriceFormatter';
|
import { PriceFormatter } from '../../../Helpers/PriceFormatter';
|
||||||
|
import { tableReload } from '../../../../store/TableReloads';
|
||||||
|
import { useDispatch } from 'react-redux';
|
||||||
|
|
||||||
const validationSchema = Yup.object().shape({
|
const validationSchema = Yup.object().shape({
|
||||||
// amount: Yup.string()
|
// amount: Yup.string()
|
||||||
@@ -28,6 +30,8 @@ const validationSchema = Yup.object().shape({
|
|||||||
|
|
||||||
function FamilyAddFundPopout({action, situation, wallet, familyData}) {
|
function FamilyAddFundPopout({action, situation, wallet, familyData}) {
|
||||||
|
|
||||||
|
const dispatch = useDispatch()
|
||||||
|
|
||||||
const apiUrl = new usersService()
|
const apiUrl = new usersService()
|
||||||
|
|
||||||
const [startTransfer, setStartTransfer] = useState({loading:true, data: {}})
|
const [startTransfer, setStartTransfer] = useState({loading:true, data: {}})
|
||||||
@@ -54,7 +58,7 @@ function FamilyAddFundPopout({action, situation, wallet, familyData}) {
|
|||||||
wallet_uid : wallet.wallet_uid,
|
wallet_uid : wallet.wallet_uid,
|
||||||
origing_wallet_uid : startTransfer?.data?.origing_wallet_uid,
|
origing_wallet_uid : startTransfer?.data?.origing_wallet_uid,
|
||||||
currency : startTransfer?.data?.currency,
|
currency : startTransfer?.data?.currency,
|
||||||
amount : values.amount,
|
amount : values.amount*100,
|
||||||
description : values.comment,
|
description : values.comment,
|
||||||
family_transfer_mode : 100,
|
family_transfer_mode : 100,
|
||||||
action : 22014
|
action : 22014
|
||||||
@@ -91,6 +95,7 @@ function FamilyAddFundPopout({action, situation, wallet, familyData}) {
|
|||||||
setRequestStatus({loading:false, status:true, message:'Transfer Successful'})
|
setRequestStatus({loading:false, status:true, message:'Transfer Successful'})
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
setRequestStatus({loading:false, status:false, message:''})
|
setRequestStatus({loading:false, status:false, message:''})
|
||||||
|
dispatch(tableReload({ type: "WALLETTABLE" })); // UPDATES PARENT WALLET ACCOUNT
|
||||||
action() // TO CLOSE THE MODAL
|
action() // TO CLOSE THE MODAL
|
||||||
}, 5000)
|
}, 5000)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
|
|||||||
Reference in New Issue
Block a user