From 497407112ca225a7fca7178b4d3afad6344166fe Mon Sep 17 00:00:00 2001 From: victorAnumudu Date: Mon, 12 Jun 2023 14:10:26 +0100 Subject: [PATCH] unused code cleaned --- src/components/MyWallet/Wallet.jsx | 46 +----------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/src/components/MyWallet/Wallet.jsx b/src/components/MyWallet/Wallet.jsx index 7237fd9..23cf8fe 100644 --- a/src/components/MyWallet/Wallet.jsx +++ b/src/components/MyWallet/Wallet.jsx @@ -20,9 +20,6 @@ function Wallet() { } - - - const WalletRoutes = () => { const apiCall = new usersService() @@ -38,18 +35,6 @@ const WalletRoutes = () => { error: false }) - let [purchaseHistory, setPurchaseHistory] = useState({ // FOR PURCHASE HISTORY - loading: true, - data: [], - error: false - }) - - let [couponHistory, setCouponHistory] = useState({ // FOR COUPON HISTORY - loading: true, - data: [], - error: false - }) - //FUNCTION TO GET WALLET LIST const getWalletList = ()=>{ apiCall.getUserWallets(null).then((res)=>{ @@ -76,38 +61,9 @@ const WalletRoutes = () => { }) } - //FUNCTION TO GET PURCHASE HISTORY - const getPurchaseHistory = ()=>{ - apiCall.getPurchaseHx().then((res)=>{ - if(res.data.internal_return < 0){ // success but no data - setPurchaseHistory(prev => ({...prev, loading: false})) - return - } - // console.log('purchase',res.data) - setPurchaseHistory(prev => ({...prev, loading: false, data: res.data.result_list})) - }).catch((error)=>{ - setPurchaseHistory(prev => ({...prev, loading: false, error: true})) - }) - } - - //FUNCTION TO GET COUPON HISTORY - const getCouponHistory = ()=>{ - apiCall.getCouponHx().then((res)=>{ - if(res.data.internal_return < 0){ // success but no data - setCouponHistory(prev => ({...prev, loading: false})) - return - } - setCouponHistory(prev => ({...prev, loading: false, data: res.data.result_list})) - }).catch((error)=>{ - setCouponHistory(prev => ({...prev, loading: false, error: true})) - }) - } - useEffect(()=>{ getWalletList() getPaymentHistory() - getPurchaseHistory() - getCouponHistory() }, []) return ( @@ -115,7 +71,7 @@ const WalletRoutes = () => { } /> } /> } /> - } /> + } /> } /> } /> } />