logic to show reps button

This commit is contained in:
2024-05-29 16:23:35 +01:00
parent d2f1a7d8b7
commit 01f2d7d766
7 changed files with 81 additions and 44 deletions
@@ -45,7 +45,7 @@ export default async function ApiProxy(req, res) {
loggedInUserId +
"&$count=true&$orderby=createdon desc";
console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
//console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
return axios
.get(
+1 -1
View File
@@ -45,7 +45,7 @@ export default async function ApiProxy(req, res) {
contactid +
")?$select=firstname, lastname, emailaddress1, telephone1, company, address1_line1,address1_line2,address1_city, address1_county,address1_postalcode,pinswg_typeofinvolvement,pinswg_contact_associatedlpa,pinswg_preferredlanguage&$count=true";
console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
// console.log(WEBAPI_URL + queryUrl + hashAPIPath(queryUrl));
var apiResponse =
contactid.length > 0
+8 -1
View File
@@ -7,6 +7,7 @@ import {
getPortalModuleDetails,
getWatchedCases,
getPersonalAccount,
getPortalLogin,
getIP,
} from "../../actions";
import Breadcrumbs from "../../components/breadcrumbs";
@@ -82,11 +83,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
//console.log("search array:", Object.entries(query));
const { cookies } = req;
let loggedInUser = cookies.pinsUser;
const showLoginCheck = process.env.SHOWLOGIN || false;
let thisSession = await getSession(ctx);
let loggedInUser = await getPortalLogin(thisSession.user.email);
if (!thisSession) {
console.log("not has sesssion.......");
return {
@@ -99,6 +101,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
thisSession != false &&
store.dispatch(setContainerID(thisSession.user.id));
loggedInUser = await getPortalLogin(thisSession.user.email);
loggedInUser = loggedInUser.value[0].contactid;
const [accountDetails, searchResultsObj, watchedCases] =
await Promise.all([
await getPersonalAccount(loggedInUser),
@@ -123,6 +129,7 @@ export const getServerSideProps = wrapper.getServerSideProps(
store.dispatch(setWatchedCases(watchedCases));
store.dispatch(setWatchedCasesDetails(watchedCasesDetails));
store.dispatch(setSearch(Object.entries(query)));
store.dispatch(setLoggedInUserId(loggedInUser));
}
return {
props: {