fix: harmonizar pesquisa e navegacao dos catalogos em QA

This commit is contained in:
2026-10-20 18:53:41 +02:00
parent 1350b4df73
commit fd341b627e
34 changed files with 2311 additions and 1310 deletions
+12
View File
@@ -0,0 +1,12 @@
/** Only a query string is carried; the return destination is always local. */
export function catalogueDetailHref(path: string, query: string): string {
return query
? `${path}?catalogue_query=${encodeURIComponent(query)}`
: path;
}
export function catalogueReturnHref(base: string, pageUrl: string): string {
const query = new URL(pageUrl, 'https://portal.invalid').searchParams.get(
'catalogue_query',
);
return base + (query ? `?${new URLSearchParams(query).toString()}` : '');
}