linked case now link to show them

This commit is contained in:
2021-12-08 09:47:10 +00:00
parent e1d5ea6870
commit a8442a43f0
8 changed files with 70 additions and 51 deletions
+19 -4
View File
@@ -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 },
};
}
);