Merge branch 'more_log_removal' of WrenchBoard/Users-Wrench into master

This commit is contained in:
2024-11-20 15:11:36 +00:00
committed by Gogs
2 changed files with 72 additions and 63 deletions
+14 -14
View File
@@ -93,7 +93,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
apiCall apiCall
.loadProfile() .loadProfile()
.then((res) => { .then((res) => {
if (res.data.internal_return < 0) { if (res?.data?.internal_return < 0) {
setIsLogin({ loading: false, status: false }); setIsLogin({ loading: false, status: false });
return; return;
} }
@@ -119,13 +119,13 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
apiCall apiCall
.getHeroJBanners() .getHeroJBanners()
.then((res) => { .then((res) => {
if (res.data?.internal_return < 0) { if (res?.data?.internal_return < 0) {
return; return;
} }
dispatch(commonHeadBanner(res.data)); dispatch(commonHeadBanner(res.data));
}) })
.catch((error) => { .catch((error) => {
console.log("ERROR ", error); // console.log("ERROR ", error);
}); });
}, [isLogin.status, homeBanners]); }, [isLogin.status, homeBanners]);
@@ -136,7 +136,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
apiCall apiCall
.getMyNotifications() .getMyNotifications()
.then((res) => { .then((res) => {
if (res.data.internal_return < 0) { if (res?.data?.internal_return < 0) {
dispatch(updateNotifications({ loading: false, data: null })); dispatch(updateNotifications({ loading: false, data: null }));
return; return;
} }
@@ -201,11 +201,11 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
const res = await apiCall.getMyJobList(); const res = await apiCall.getMyJobList();
// setMyJobList({loading: false, data:res.data}) // setMyJobList({loading: false, data:res.data})
// setMyJobList(res.data); // setMyJobList(res.data);
dispatch(updateUserJobList({ loading: false, data: res.data })); dispatch(updateUserJobList({ loading: false, data: res?.data }));
} catch (error) { } catch (error) {
dispatch(updateUserJobList({ loading: false, data: [] })); dispatch(updateUserJobList({ loading: false, data: [] }));
// setMyJobList({loading: false, data:[]}) // setMyJobList({loading: false, data:[]})
console.log("Error getting mode"); // console.log("Error getting mode");
} }
}; };
getMyJobList(); getMyJobList();
@@ -222,11 +222,11 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
const res = await apiCall.getUserWallets(); const res = await apiCall.getUserWallets();
// console.log("wallet - >", res.data); // console.log("wallet - >", res.data);
dispatch( dispatch(
updateWalletDetails({ loading: false, data: res.data?.result_list }) updateWalletDetails({ loading: false, data: res?.data?.result_list })
); );
} catch (error) { } catch (error) {
dispatch(updateWalletDetails({ loading: false, data: [] })); dispatch(updateWalletDetails({ loading: false, data: [] }));
console.log("Error getting mode"); // console.log("Error getting mode");
} }
}; };
getMyWalletList(); getMyWalletList();
@@ -246,7 +246,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
dispatch(updateJobs({loading: false, ...res.data})); dispatch(updateJobs({loading: false, ...res.data}));
} catch (error) { } catch (error) {
dispatch(updateJobs({loading: false})); dispatch(updateJobs({loading: false}));
console.log("Error getting mode"); // console.log("Error getting mode");
} }
}; };
getMarketActiveJobList(); getMarketActiveJobList();
@@ -281,10 +281,10 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
// setFamilyBannersList({loading:true, result:[]}); // setFamilyBannersList({loading:true, result:[]});
try { try {
const res = await apiCall.getFamilyBannersList(); const res = await apiCall.getFamilyBannersList();
dispatch(familyBannersList({...res.data, loading:false})) dispatch(familyBannersList({...res?.data, loading:false}))
} catch (error) { } catch (error) {
dispatch(familyBannersList({loading:false})) dispatch(familyBannersList({loading:false}))
console.log("Error getting tasks"); // console.log("Error getting tasks");
} }
}; };
getFamilyBanners() getFamilyBanners()
@@ -301,7 +301,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
dispatch(familyResources(res?.data?.result_list)) dispatch(familyResources(res?.data?.result_list))
// console.log('RESPONSE', res?.data?.result_list) // console.log('RESPONSE', res?.data?.result_list)
} catch (error) { } catch (error) {
console.log("Error getting tasks"); // console.log("Error getting tasks");
} }
}; };
getFamilyResourcesList() getFamilyResourcesList()
@@ -318,7 +318,7 @@ const AuthRoute = ({ redirectPath = "/login", children }) => {
apiCall.getFamilyWalletRedeemOptions().then((res)=>{ apiCall.getFamilyWalletRedeemOptions().then((res)=>{
dispatch(familyWalletRedeemOptList({loading: false, image: res?.data?.session_image_server, data:res?.data?.result_list})) dispatch(familyWalletRedeemOptList({loading: false, image: res?.data?.session_image_server, data:res?.data?.result_list}))
}).catch((err)=>{ }).catch((err)=>{
console.log(err) // console.log(err)
dispatch(familyWalletRedeemOptList({loading: false, image: '', data:{}})) 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 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){ if(loggedIn || isLogin.status){
joinRoom(`FAMILY-${account_type == 'FULL' ? uid : sessionStorage.getItem('parent_uid')}`) 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]) },[isLogin.status])
+58 -49
View File
@@ -3,7 +3,7 @@ import { apiConst } from "../lib/apiConst";
class usersService { class usersService {
constructor() { constructor() {
console.log("WRB Service Entry"); // console.log("WRB Service Entry");
} }
MyPageIntro(reqData) { MyPageIntro(reqData) {
@@ -1644,19 +1644,22 @@ class usersService {
}, },
}) })
.then((response) => { .then((response) => {
console.log("~~~~~~~ Toks2 GET ~~~~~~~~"); // console.log("~~~~~~~ Toks2 GET ~~~~~~~~");
return response; return response;
}) })
.catch((error) => { .catch((error) => {
if (error.response) { if (error.response) {
//response status is an error code //response status is an error code
console.log(error.response.status); // console.log(error.response.status);
return
} else if (error.request) { } else if (error.request) {
//response not received though the request was sent //response not received though the request was sent
console.log(error.request); // console.log(error.request);
return
} else { } else {
//an error occurred when setting up the request //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) return Axios.post(endPoint, reqData)
.then((response) => { .then((response) => {
// console.log(response); // console.log(response);
console.log("~~~~~~~ WrenchBoard::POST ~~~~~~~~"); // console.log("~~~~~~~ WrenchBoard::POST ~~~~~~~~");
if (response.data.internal_return == "-9999") { if (response.data.internal_return == "-9999") {
localStorage.clear(); localStorage.clear();
window.location.href = `/login?sessionExpired=true`; window.location.href = `/login?sessionExpired=true`;
@@ -1696,31 +1699,34 @@ class usersService {
.catch((error) => { .catch((error) => {
if (error.response) { if (error.response) {
//response status is an error code //response status is an error code
console.log( // console.log(
"ERROR-------------------------------------------------------" // "ERROR-------------------------------------------------------"
); // );
console.log(error.response.status); // console.log(error.response.status);
console.log( // console.log(
"ERROR-------------------------------------------------------" // "ERROR-------------------------------------------------------"
); // );
return
} else if (error.request) { } else if (error.request) {
//response not received though the request was sent //response not received though the request was sent
console.log( // console.log(
"ERROR2-------------------------------------------------------" // "ERROR2-------------------------------------------------------"
); // );
console.log(error?.request); // console.log(error?.request);
console.log( // console.log(
"ERROR2-------------------------------------------------------" // "ERROR2-------------------------------------------------------"
); // );
return
} else { } else {
//an error occurred when setting up the request //an error occurred when setting up the request
console.log( // console.log(
"ERROR3-------------------------------------------------------" // "ERROR3-------------------------------------------------------"
); // );
console.log(error); // console.log(error);
console.log( // console.log(
"ERROR3-------------------------------------------------------" // "ERROR3-------------------------------------------------------"
); // );
return
} }
}); });
} }
@@ -1753,7 +1759,7 @@ class usersService {
.then((response) => { .then((response) => {
// console.log(response); // console.log(response);
// res = response; // res = response;
console.log("~~~~~~~ Toks2 POST ~~~~~~~~"); // console.log("~~~~~~~ Toks2 POST ~~~~~~~~");
if (response.data.internal_return == "-9999") { if (response.data.internal_return == "-9999") {
localStorage.clear(); localStorage.clear();
window.location.href = `/login?sessionExpired=true`; window.location.href = `/login?sessionExpired=true`;
@@ -1763,31 +1769,34 @@ class usersService {
.catch((error) => { .catch((error) => {
if (error.response) { if (error.response) {
//response status is an error code //response status is an error code
console.log( // console.log(
"ERROR-------------------------------------------------------" // "ERROR-------------------------------------------------------"
); // );
console.log(error.response.status); // console.log(error.response.status);
console.log( // console.log(
"ERROR-------------------------------------------------------" // "ERROR-------------------------------------------------------"
); // );
return
} else if (error.request) { } else if (error.request) {
//response not received though the request was sent //response not received though the request was sent
console.log( // console.log(
"ERROR2-------------------------------------------------------" // "ERROR2-------------------------------------------------------"
); // );
console.log(error?.request); // console.log(error?.request);
console.log( // console.log(
"ERROR2-------------------------------------------------------" // "ERROR2-------------------------------------------------------"
); // );
return
} else { } else {
//an error occurred when setting up the request //an error occurred when setting up the request
console.log( // console.log(
"ERROR3-------------------------------------------------------" // "ERROR3-------------------------------------------------------"
); // );
console.log(error); // console.log(error);
console.log( // console.log(
"ERROR3-------------------------------------------------------" // "ERROR3-------------------------------------------------------"
); // );
return
} }
}); });
} }