updated serching to reduce CRM calls for performance and stability

This commit is contained in:
2025-10-28 11:21:38 +00:00
parent df199cff53
commit e54a0b2253
12 changed files with 265 additions and 164 deletions
+5 -19
View File
@@ -100,20 +100,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
},
};
} else {
let [searchResultsObj, loggedInUser] = await Promise.all([
await getBasicSearch(query.q),
let [loggedInUser] = await Promise.all([
await getPortalLogin(thisSession.user.email),
]);
searchResultsObj =
searchResultsObj.status == 502
? {
value: [],
errorCode: searchResultsObj.status,
errorMsg: searchResultsObj.statusText,
}
: searchResultsObj;
//console.log("sssss", searchResultsObj);
loggedInUser = loggedInUser.value[0].contactid;
@@ -122,15 +112,11 @@ export const getServerSideProps = wrapper.getServerSideProps(
//console.log("sssss", loggedInUser);
const [accountDetails, searchDetailsObj, watchedCasesDetails] =
await Promise.all([
await getPersonalAccount(loggedInUser),
await getSearchDetails(searchResultsObj),
await getDetails(watchedCases, "myWatchedCases"),
]);
const [accountDetails, watchedCasesDetails] = await Promise.all([
await getPersonalAccount(loggedInUser),
await getDetails(watchedCases, "myWatchedCases"),
]);
store.dispatch(setAccountDetails(accountDetails));
store.dispatch(setSearchResults(searchResultsObj));
store.dispatch(setSearchDetails(searchDetailsObj));
store.dispatch(setSearch(query.q));
store.dispatch(setWatchedCases(watchedCases));
store.dispatch(setWatchedCasesDetails(watchedCasesDetails));