import axios from "axios"; import { walletActionUrl } from "./IlinkConstants"; import { fetchWalletListPending, fetchWalletListSuccess, fetchWalletListError } from "../redux/actions/WalletActions"; const getWalletActivated = (userID) => { return dispatch => { dispatch(fetchWalletListPending()); axios.post(`${walletActionUrl}/${userID}/activated`) .then(response => { console.log(response); dispatch(fetchWalletListSuccess(response)); }) .catch(error => { dispatch(fetchWalletListError(error.message)); if (error.response) dispatch(fetchWalletListError(error.response)); else if (error.request) dispatch(fetchWalletListError(error.request)) else dispatch(fetchWalletListError(error.message)) }); } } export default getWalletActivated;