I have below piece of code
export const getCartFromApi = () => {
try {
const postData = { meta: {}, data: { cartId } };
const apiResponse = HttpService.post(`${getSecureBaseUrl()}` + apiUrls.getCartDetailsurl, postData);
Promise.all([apiResponse]).then((res) => {
console.log('api response', res);
if (res[0] && res[0].data && res[0].status === 200) {
store.dispatch({ type: Constants.GET_CART_SUCCESS, response: res[0].data });
setTimeout(() => {
hideLoader(store.dispatch);
}, 2000);
return res;
}
setTimeout(() => {
hideLoader(store.dispatch);
}, 3000);
return res;
});
} catch (error) {
}
};
When im trying to access getCartfrom api is says undefined.
What am I missing here?