fix: preserve territorial search across investment catalogues

This commit is contained in:
2026-10-22 12:52:52 +02:00
parent 5f4eb5cfaa
commit 9ac623a433
14 changed files with 118 additions and 24 deletions
+4 -3
View File
@@ -1,6 +1,7 @@
import { Link, useForm, router, usePage } from '@inertiajs/react';
import { useState } from 'react';
import { catalogueReturnHref } from '@/lib/catalogue-context';
import { searchTerritoryHref } from '@/lib/search-territory';
import InvestmentMapPanel from '@/components/investment-map-panel';
import StructureGeographyPanel, {
type StructureGeography,
@@ -190,7 +191,7 @@ function Editor({
</h2>
{zones.map((z) => (
<p key={z.id}>
<Link className="underline" href={`/zonas/${z.id}`}>
<Link className="underline" href={searchTerritoryHref(`/zonas/${z.id}`, pageUrl)}>
{z.name}
</Link>{' '}
· {z.association_type} · Fonte: {z.source_reference}
@@ -297,7 +298,7 @@ function Editor({
<article key={opportunity.id}>
<Link
className="font-semibold underline"
href={`/oportunidades/${opportunity.slug}?from_dossier=${record.id}`}
href={searchTerritoryHref(`/oportunidades/${opportunity.slug}?from_dossier=${record.id}`, pageUrl)}
>
{opportunity.title}
</Link>
@@ -485,7 +486,7 @@ function Editor({
{kind(r)}:{' '}
<Link
className="underline"
href={`${base}/${r.id}${management ? '' : `?from=${record.id}`}`}
href={searchTerritoryHref(`${base}/${r.id}${management ? '' : `?from=${record.id}`}`, pageUrl)}
>
{r.title}
</Link>