update dns subsection autosuggest list
This commit is contained in:
@@ -66,7 +66,15 @@ export const getSearchDetails = (searchResultsObj) => {
|
||||
searchResultsObj = searchResultsObj.value;
|
||||
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
||||
if (searchDetail.pinswg_appealcasetype == null) {
|
||||
console.log(searchDetail.title);
|
||||
//console.log(searchDetail.title);
|
||||
detailsArr.push(
|
||||
getBasicSearchDetails(
|
||||
"pinswg_dnses",
|
||||
searchDetail.title,
|
||||
"pinswg_dnsid",
|
||||
searchDetail.incidentid
|
||||
)
|
||||
);
|
||||
} else {
|
||||
let formMeta = getFormCollectionByID(
|
||||
searchDetail.pinswg_appealcasetype
|
||||
|
||||
@@ -119,9 +119,9 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
const searchResultsObj = await getAdvancedSearch(query);
|
||||
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
||||
|
||||
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
||||
store.dispatch(setShowReps(showReps));
|
||||
store.dispatch(setShowReps(showReps, showLoginCheck));
|
||||
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
|
||||
@@ -84,6 +84,13 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch("DNS"));
|
||||
}
|
||||
} else {
|
||||
const searchDetailsObj = await getSearchDetails(
|
||||
searchResultsObj
|
||||
);
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch("DNS"));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
+34
-38
@@ -121,52 +121,48 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
const { query, req, res } = ctx;
|
||||
console.log("query-", query);
|
||||
|
||||
let isLinked =
|
||||
typeof query.lk != "undefined" && query.lk == "1"
|
||||
? true
|
||||
: false;
|
||||
let isLinked =
|
||||
typeof query.lk != "undefined" && query.lk == "1" ? true : false;
|
||||
|
||||
//console.log("is linked:", isLinked);
|
||||
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
||||
store.dispatch(setShowReps(showReps));
|
||||
//console.log("is linked:", isLinked);
|
||||
const showLoginCheck = process.env.SHOWLOGIN || false;
|
||||
const showReps = process.env.SHOWREPRESENTATIONS || false;
|
||||
store.dispatch(setShowReps(showReps, showLoginCheck));
|
||||
|
||||
let searchResultsObj = await getBasicSearch(query.q);
|
||||
let searchResultsObj = await getBasicSearch(query.q);
|
||||
|
||||
searchResultsObj =
|
||||
searchResultsObj.status == 502
|
||||
? {
|
||||
value: [],
|
||||
errorCode: searchResultsObj.status,
|
||||
errorMsg: searchResultsObj.statusText,
|
||||
}
|
||||
: searchResultsObj;
|
||||
|
||||
if (_.has(searchResultsObj, "status") == true) {
|
||||
return {
|
||||
redirect: {
|
||||
//destination: "/dns-not-found",
|
||||
destination: "/error",
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
const searchDetailsObj = await getSearchDetails(
|
||||
searchResultsObj
|
||||
);
|
||||
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch(query.q));
|
||||
}
|
||||
searchResultsObj =
|
||||
searchResultsObj.status == 502
|
||||
? {
|
||||
value: [],
|
||||
errorCode: searchResultsObj.status,
|
||||
errorMsg: searchResultsObj.statusText,
|
||||
}
|
||||
: searchResultsObj;
|
||||
|
||||
if (_.has(searchResultsObj, "status") == true) {
|
||||
return {
|
||||
props: {
|
||||
isLinkedCase: isLinked,
|
||||
showLoginCheck: showLoginCheck,
|
||||
redirect: {
|
||||
//destination: "/dns-not-found",
|
||||
destination: "/error",
|
||||
permanent: false,
|
||||
},
|
||||
};
|
||||
} else {
|
||||
const searchDetailsObj = await getSearchDetails(searchResultsObj);
|
||||
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch(query.q));
|
||||
}
|
||||
|
||||
return {
|
||||
props: {
|
||||
isLinkedCase: isLinked,
|
||||
showLoginCheck: showLoginCheck,
|
||||
},
|
||||
};
|
||||
}
|
||||
// }
|
||||
// }
|
||||
);
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ const makeStore = ({ isServer }) => {
|
||||
key: "acp",
|
||||
whitelist: [
|
||||
"currentView",
|
||||
"searchResultsObj",
|
||||
//"searchResultsObj",
|
||||
"appealType",
|
||||
"LPAData",
|
||||
"accountDetails",
|
||||
|
||||
Reference in New Issue
Block a user