added family wallet redeem options

This commit was merged in pull request #629.
This commit is contained in:
victorAnumudu
2024-03-08 21:50:42 +01:00
parent 71ee75072d
commit 7f83cd5cc6
6 changed files with 140 additions and 35 deletions
+19
View File
@@ -13,6 +13,7 @@ import { updateUserJobList } from "../store/userJobList";
import { updateWalletDetails } from "../store/walletDetails";
import { familyBannersList } from "../store/FamilyBannerList";
import { familyResources } from "../store/FamilyResources";
import {familyWalletRedeemOptList} from '../store/FamilyWalletRedeemOpt'
const AuthRoute = ({ redirectPath = "/login", children }) => {
const apiCall = useMemo(() => new usersService(), []);
@@ -291,6 +292,24 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
}, [isLogin.status]);
//FUNCTION TO GET FAMILY WALLET REDEEM OPTIONS
useEffect(() => {
if((!loggedIn && !isLogin.status) || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
return
}
const familyWalletRedeemOptions = async () => { // FUNCTION TO GET FAMILY WALLET REDDEM OPTIONS
dispatch(familyWalletRedeemOptList({loading: true, image: '', data:{}}))
apiCall.getFamilyWalletRedeemOptions().then((res)=>{
dispatch(familyWalletRedeemOptList({loading: false, image: res?.data?.session_image_server, data:res?.data?.result_list}))
}).catch((err)=>{
console.log(err)
dispatch(familyWalletRedeemOptList({loading: false, image: '', data:{}}))
})
};
familyWalletRedeemOptions()
}, [isLogin.status]);
// RENDER PAGE
return isLogin.loading && !loggedIn ? (
<LoadingSpinner size="32" color="sky-blue" height="h-screen" />