ilink-world/webservice/WalletApi.js

27 lines
1.0 KiB
JavaScript
Raw Normal View History

2020-04-18 19:59:05 +00:00
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;