language routing
This commit is contained in:
@@ -45,6 +45,7 @@ function Error({ statusCode }, props) {
|
||||
|
||||
Error.getInitialProps = ({ res, err }) => {
|
||||
const statusCode = res ? res.statusCode : err ? err.statusCode : 404;
|
||||
console.log(res, err);
|
||||
return { statusCode };
|
||||
};
|
||||
|
||||
|
||||
@@ -67,8 +67,15 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
const token = await getSASToken();
|
||||
|
||||
const searchResultsObj = await getBasicDNSSearch(token);
|
||||
//console.log(searchResultsObj);
|
||||
let searchResultsObj = await getBasicDNSSearch(token);
|
||||
searchResultsObj =
|
||||
searchResultsObj.status == 502
|
||||
? {
|
||||
value: [],
|
||||
errorCode: searchResultsObj.status,
|
||||
errorMsg: searchResultsObj.statusText,
|
||||
}
|
||||
: searchResultsObj;
|
||||
|
||||
const searchDetailsObj = await getSearchDetails(
|
||||
token,
|
||||
|
||||
@@ -48,6 +48,12 @@ const Home = (props) => {
|
||||
searchDetailsObj={
|
||||
props.searchResultsObj.searchDetailsObj
|
||||
}
|
||||
documentDetailsObj={
|
||||
props.searchResultsObj.documentDetailsObj
|
||||
}
|
||||
documentHistoryObj={
|
||||
props.searchResultsObj.documentHistoryObj
|
||||
}
|
||||
myRepresentations={
|
||||
props.myRepresentations.myRepresentations
|
||||
}
|
||||
@@ -61,6 +67,7 @@ const Home = (props) => {
|
||||
currentType={
|
||||
props.currentView.caseReference.currentType
|
||||
}
|
||||
incidentid={props.currentView.caseReference.incidentid}
|
||||
/>
|
||||
</div>
|
||||
<Footer footerLinks={footerLinks} />
|
||||
|
||||
@@ -71,7 +71,15 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
|
||||
const token = await getSASToken();
|
||||
|
||||
const searchResultsObj = await getBasicSearch(token, query.q);
|
||||
let searchResultsObj = await getBasicSearch(token, query.q);
|
||||
|
||||
searchResultsObj =
|
||||
searchResultsObj.status == 502
|
||||
? {
|
||||
value: [],
|
||||
errorMsg: searchResultsObj.statusText,
|
||||
}
|
||||
: searchResultsObj;
|
||||
|
||||
//console.log("sssss", searchResultsObj);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user