added family resources API
This commit was merged in pull request #585.
This commit is contained in:
@@ -12,6 +12,7 @@ import { updateNotifications } from "../store/notifications";
|
||||
import { updateUserJobList } from "../store/userJobList";
|
||||
import { updateWalletDetails } from "../store/walletDetails";
|
||||
import { familyBannersList } from "../store/FamilyBannerList";
|
||||
import { familyResources } from "../store/FamilyResources";
|
||||
|
||||
const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
const apiCall = useMemo(() => new usersService(), []);
|
||||
@@ -271,6 +272,23 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
|
||||
getFamilyBanners()
|
||||
}, [isLogin.status, familyBannersListTable]);
|
||||
|
||||
//FUNCTION TO GET FAMILY RESOURCES
|
||||
useEffect(() => {
|
||||
if((!loggedIn && !isLogin.status) || account_type == 'FULL'){ // DO NOT CALL THIS, IF USER ACCOUNT TYPE IS FULL
|
||||
return
|
||||
}
|
||||
const getFamilyResourcesList = async () => { // FUNCTION TO GET FAMILY BANNERS
|
||||
try {
|
||||
const res = await apiCall.getFamilyResources();
|
||||
dispatch(familyResources(res?.data?.result_list))
|
||||
// console.log('RESPONSE', res?.data?.result_list)
|
||||
} catch (error) {
|
||||
console.log("Error getting tasks");
|
||||
}
|
||||
};
|
||||
getFamilyResourcesList()
|
||||
}, [isLogin.status, familyBannersListTable]);
|
||||
|
||||
// useEffect(() => {
|
||||
// apiCall
|
||||
// .getHeroJBanners()
|
||||
|
||||
Reference in New Issue
Block a user