From 3ad77427737d9ff873f5f2cd7b9c929490df7841 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Mon, 29 May 2023 16:14:55 +0100 Subject: [PATCH] sorted out redirect to property and set up the property page --- src/app/portfolio/[slug]/property/[lmkKey]/page.tsx | 7 +++++++ src/app/portfolio/[slug]/search/page.tsx | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 src/app/portfolio/[slug]/property/[lmkKey]/page.tsx diff --git a/src/app/portfolio/[slug]/property/[lmkKey]/page.tsx b/src/app/portfolio/[slug]/property/[lmkKey]/page.tsx new file mode 100644 index 0000000..5a4e834 --- /dev/null +++ b/src/app/portfolio/[slug]/property/[lmkKey]/page.tsx @@ -0,0 +1,7 @@ +export default function () { + return ( + <> +

Hello world

+ + ); +} diff --git a/src/app/portfolio/[slug]/search/page.tsx b/src/app/portfolio/[slug]/search/page.tsx index 4e2d9ef..2bada9f 100644 --- a/src/app/portfolio/[slug]/search/page.tsx +++ b/src/app/portfolio/[slug]/search/page.tsx @@ -59,17 +59,17 @@ export default function Search({ params }: { params: { slug: string } }) { } } - const redirectToEpc = () => { + const redirectToProperty = () => { if (data === null) return; const res = data.rows.find( (row: SearchResult) => row["lmk-key"] === currentlyToggled - ); + ) as SearchResult; const portfolioId = params.slug; - const propertyId = res ? ["lmk-key"] : ""; + const lmkKey = res["lmk-key"]; - router.push(`/portfolio/${portfolioId}/property/${propertyId}`); + router.push(`/portfolio/${portfolioId}/property/${lmkKey}`); }; const submitProps = { @@ -131,7 +131,7 @@ export default function Search({ params }: { params: { slug: string } }) {