removed more logs from the browser #849

Merged
ameye merged 1 commits from more_log_removal into master 2024-11-20 15:11:37 +00:00
2 changed files with 72 additions and 63 deletions
+14 -14
View File
@@ -93,7 +93,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
apiCall
.loadProfile()
.then((res) => {
if (res.data.internal_return < 0) {
if (res?.data?.internal_return < 0) {
setIsLogin({ loading: false, status: false });
return;
}
@@ -119,13 +119,13 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
apiCall
.getHeroJBanners()
.then((res) => {
if (res.data?.internal_return < 0) {
if (res?.data?.internal_return < 0) {
return;
}
dispatch(commonHeadBanner(res.data));
})
.catch((error) => {
console.log("ERROR ", error);
// console.log("ERROR ", error);
});
}, [isLogin.status, homeBanners]);
@@ -136,7 +136,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
apiCall
.getMyNotifications()
.then((res) => {
if (res.data.internal_return < 0) {
if (res?.data?.internal_return < 0) {
dispatch(updateNotifications({ loading: false, data: null }));
return;
}
@@ -201,11 +201,11 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
const res = await apiCall.getMyJobList();
// setMyJobList({loading: false, data:res.data})
// setMyJobList(res.data);
dispatch(updateUserJobList({ loading: false, data: res.data }));
dispatch(updateUserJobList({ loading: false, data: res?.data }));
} catch (error) {
dispatch(updateUserJobList({ loading: false, data: [] }));
// setMyJobList({loading: false, data:[]})
console.log("Error getting mode");
// console.log("Error getting mode");
}
};
getMyJobList();
@@ -222,11 +222,11 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
const res = await apiCall.getUserWallets();
// console.log("wallet - >", res.data);
dispatch(
updateWalletDetails({ loading: false, data: res.data?.result_list })
updateWalletDetails({ loading: false, data: res?.data?.result_list })
);
} catch (error) {
dispatch(updateWalletDetails({ loading: false, data: [] }));
console.log("Error getting mode");
// console.log("Error getting mode");
}
};
getMyWalletList();
@@ -246,7 +246,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
dispatch(updateJobs({loading: false, ...res.data}));
} catch (error) {
dispatch(updateJobs({loading: false}));
console.log("Error getting mode");
// console.log("Error getting mode");
}
};
getMarketActiveJobList();
@@ -281,10 +281,10 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
// setFamilyBannersList({loading:true, result:[]});
try {
const res = await apiCall.getFamilyBannersList();
dispatch(familyBannersList({...res.data, loading:false}))
dispatch(familyBannersList({...res?.data, loading:false}))
} catch (error) {
dispatch(familyBannersList({loading:false}))
console.log("Error getting tasks");
// console.log("Error getting tasks");
}
};
getFamilyBanners()
@@ -301,7 +301,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
dispatch(familyResources(res?.data?.result_list))
// console.log('RESPONSE', res?.data?.result_list)
} catch (error) {
console.log("Error getting tasks");
// console.log("Error getting tasks");
}
};
getFamilyResourcesList()
@@ -318,7 +318,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
apiCall.getFamilyWalletRedeemOptions().then((res)=>{
dispatch(familyWalletRedeemOptList({loading: false, image: res?.data?.session_image_server, data:res?.data?.result_list}))
}).catch((err)=>{
console.log(err)
// console.log(err)
dispatch(familyWalletRedeemOptList({loading: false, image: '', data:{}}))
})
};
@@ -332,7 +332,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
useEffect(()=>{ // sends an event to the socket to enable user join a room to be able to receive update for parent child job assign
if(loggedIn || isLogin.status){
joinRoom(`FAMILY-${account_type == 'FULL' ? uid : sessionStorage.getItem('parent_uid')}`)
console.log(`Room joined for parent child task assign as ${account_type} with ${account_type == 'FULL' ? uid : sessionStorage.getItem('parent_uid')}}`)
// console.log(`Room joined for parent child task assign as ${account_type} with ${account_type == 'FULL' ? uid : sessionStorage.getItem('parent_uid')}}`)
}
},[isLogin.status])
+58 -49
View File
@@ -3,7 +3,7 @@ import { apiConst } from "../lib/apiConst";
class usersService {
constructor() {
console.log("WRB Service Entry");
// console.log("WRB Service Entry");
}
MyPageIntro(reqData) {
@@ -1644,19 +1644,22 @@ class usersService {
},
})
.then((response) => {
console.log("~~~~~~~ Toks2 GET ~~~~~~~~");
// console.log("~~~~~~~ Toks2 GET ~~~~~~~~");
return response;
})
.catch((error) => {
if (error.response) {
//response status is an error code
console.log(error.response.status);
// console.log(error.response.status);
return
} else if (error.request) {
//response not received though the request was sent
console.log(error.request);
// console.log(error.request);
return
} else {
//an error occurred when setting up the request
console.log(error.message);
// console.log(error.message);
return
}
});
}
@@ -1686,7 +1689,7 @@ class usersService {
return Axios.post(endPoint, reqData)
.then((response) => {
// console.log(response);
console.log("~~~~~~~ WrenchBoard::POST ~~~~~~~~");
// console.log("~~~~~~~ WrenchBoard::POST ~~~~~~~~");
if (response.data.internal_return == "-9999") {
localStorage.clear();
window.location.href = `/login?sessionExpired=true`;
@@ -1696,31 +1699,34 @@ class usersService {
.catch((error) => {
if (error.response) {
//response status is an error code
console.log(
"ERROR-------------------------------------------------------"
);
console.log(error.response.status);
console.log(
"ERROR-------------------------------------------------------"
);
// console.log(
// "ERROR-------------------------------------------------------"
// );
// console.log(error.response.status);
// console.log(
// "ERROR-------------------------------------------------------"
// );
return
} else if (error.request) {
//response not received though the request was sent
console.log(
"ERROR2-------------------------------------------------------"
);
console.log(error?.request);
console.log(
"ERROR2-------------------------------------------------------"
);
// console.log(
// "ERROR2-------------------------------------------------------"
// );
// console.log(error?.request);
// console.log(
// "ERROR2-------------------------------------------------------"
// );
return
} else {
//an error occurred when setting up the request
console.log(
"ERROR3-------------------------------------------------------"
);
console.log(error);
console.log(
"ERROR3-------------------------------------------------------"
);
// console.log(
// "ERROR3-------------------------------------------------------"
// );
// console.log(error);
// console.log(
// "ERROR3-------------------------------------------------------"
// );
return
}
});
}
@@ -1753,7 +1759,7 @@ class usersService {
.then((response) => {
// console.log(response);
// res = response;
console.log("~~~~~~~ Toks2 POST ~~~~~~~~");
// console.log("~~~~~~~ Toks2 POST ~~~~~~~~");
if (response.data.internal_return == "-9999") {
localStorage.clear();
window.location.href = `/login?sessionExpired=true`;
@@ -1763,31 +1769,34 @@ class usersService {
.catch((error) => {
if (error.response) {
//response status is an error code
console.log(
"ERROR-------------------------------------------------------"
);
console.log(error.response.status);
console.log(
"ERROR-------------------------------------------------------"
);
// console.log(
// "ERROR-------------------------------------------------------"
// );
// console.log(error.response.status);
// console.log(
// "ERROR-------------------------------------------------------"
// );
return
} else if (error.request) {
//response not received though the request was sent
console.log(
"ERROR2-------------------------------------------------------"
);
console.log(error?.request);
console.log(
"ERROR2-------------------------------------------------------"
);
// console.log(
// "ERROR2-------------------------------------------------------"
// );
// console.log(error?.request);
// console.log(
// "ERROR2-------------------------------------------------------"
// );
return
} else {
//an error occurred when setting up the request
console.log(
"ERROR3-------------------------------------------------------"
);
console.log(error);
console.log(
"ERROR3-------------------------------------------------------"
);
// console.log(
// "ERROR3-------------------------------------------------------"
// );
// console.log(error);
// console.log(
// "ERROR3-------------------------------------------------------"
// );
return
}
});
}