linked case now link to show them
This commit is contained in:
+19
-4
@@ -25,19 +25,23 @@ import { getBasicSearch, getBasicSearchDetails, getToken } from "../actions";
|
||||
import { getSearchDetails } from "../components/utils";
|
||||
|
||||
const Home = (props) => {
|
||||
const { footerLinks, pages } = props;
|
||||
const { footerLinks, pages, isLinkedCase } = props;
|
||||
let { t, lang } = useTranslation();
|
||||
|
||||
const router = useRouter();
|
||||
const { locale } = router;
|
||||
const { appealtypes } = router.query;
|
||||
|
||||
const pageTitle = isLinkedCase
|
||||
? t("search:searchresults-title-label-linked-case") +
|
||||
" - " +
|
||||
t("common:service-name")
|
||||
: t("search:page-title") + " - " + t("common:service-name");
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Head>
|
||||
<title>
|
||||
{t("search:page-title")} - {t("common:service-name")}
|
||||
</title>
|
||||
<title>{pageTitle}</title>
|
||||
<>
|
||||
<link
|
||||
rel="canonical"
|
||||
@@ -108,6 +112,7 @@ const Home = (props) => {
|
||||
<SearchResults
|
||||
searchString={props.search.searchString}
|
||||
searchResultsObj={props.searchResultsObj}
|
||||
isLinkedCase={isLinkedCase}
|
||||
/>
|
||||
</div>
|
||||
<Footer footerLinks={footerLinks} />
|
||||
@@ -121,6 +126,12 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
async ({ query, req, res }) => {
|
||||
console.log("query-", query);
|
||||
|
||||
let isLinked =
|
||||
typeof query.lk != "undefined" && query.lk == "1"
|
||||
? true
|
||||
: false;
|
||||
|
||||
console.log("is linked:", isLinked);
|
||||
let token = await getToken();
|
||||
|
||||
var tokenIssuedAt = new Date();
|
||||
@@ -161,6 +172,10 @@ export const getServerSideProps = wrapper.getServerSideProps(
|
||||
store.dispatch(setSearchResults(searchResultsObj));
|
||||
store.dispatch(setSearchDetails(searchDetailsObj));
|
||||
store.dispatch(setSearch(query.q));
|
||||
|
||||
return {
|
||||
props: { isLinkedCase: isLinked },
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user