mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
sorted out redirect to property and set up the property page
This commit is contained in:
parent
431c416f2d
commit
3ad7742773
2 changed files with 12 additions and 5 deletions
7
src/app/portfolio/[slug]/property/[lmkKey]/page.tsx
Normal file
7
src/app/portfolio/[slug]/property/[lmkKey]/page.tsx
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export default function () {
|
||||
return (
|
||||
<>
|
||||
<h1> Hello world</h1>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
@ -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 } }) {
|
|||
<div className="flex justify-end">
|
||||
<SelectAddressButton
|
||||
buttonDisabled={addressButtonDisabled}
|
||||
redirectFunc={redirectToEpc}
|
||||
redirectFunc={redirectToProperty}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue