fix: harmonizar pesquisa e navegacao dos catalogos em QA
This commit is contained in:
@@ -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()}` : '');
|
||||
}
|
||||
Reference in New Issue
Block a user