made wallet to reload on coupon redeem
This commit was merged in pull request #399.
This commit is contained in:
@@ -10,6 +10,7 @@ import { updateUserDetails } from "../store/UserDetails";
|
||||
import { updateJobs } from "../store/jobLists";
|
||||
import { updateNotifications } from "../store/notifications";
|
||||
import { updateUserJobList } from "../store/userJobList";
|
||||
import { updateWalletDetails } from "../store/walletDetails";
|
||||
|
||||
const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
const apiCall = useMemo(() => new usersService(), []);
|
||||
@@ -19,7 +20,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
const [loadProfileDetails, setLoadProfileDetails] = useState([]);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const { jobListTable } = useSelector((state) => state.tableReload);
|
||||
const { jobListTable, walletTable } = useSelector((state) => state.tableReload);
|
||||
|
||||
const {
|
||||
userDetails: { username, uid, session },
|
||||
@@ -177,6 +178,21 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
getMyJobList();
|
||||
}, [jobListTable]);
|
||||
|
||||
useEffect(() => {
|
||||
const getMyWalletList = async () => {
|
||||
dispatch(updateWalletDetails({ loading: true, data:[] }));
|
||||
try {
|
||||
const res = await apiCall.getUserWallets();
|
||||
console.log("wallet - >", res.data);
|
||||
dispatch(updateWalletDetails({ loading: false, data:res.data?.result_list }));
|
||||
} catch (error) {
|
||||
dispatch(updateWalletDetails({ loading: false, data:[] }));
|
||||
console.log("Error getting mode");
|
||||
}
|
||||
};
|
||||
getMyWalletList();
|
||||
}, [walletTable]);
|
||||
|
||||
useEffect(() => {
|
||||
// Getting market data
|
||||
const getMarketActiveJobList = async () => {
|
||||
|
||||
Reference in New Issue
Block a user