feat(documents): thread undated filter through the search loader + i18n
Parses ?undated strictly (=== 'true', mirroring the tagOp clamp), forwards
it as undated || undefined so the absent case drops out of the query, and
returns the flag in page data for the control to reflect. Adds the
docs_filter_undated_only toggle label and the explanatory
docs_range_excludes_undated empty-state copy in de/en/es. The badge reuses
the existing date_precision_unknown ("Datum unbekannt") key from #677.
OpenAPI types hand-edited for the new undated query param on /search and
/ids — CI must run `npm run generate:api` to confirm parity with the spec.
Refs #668
This commit is contained in:
@@ -46,6 +46,8 @@ export async function load({ url, fetch }) {
|
||||
: 'desc';
|
||||
const tagQ = url.searchParams.get('tagQ') || '';
|
||||
const tagOp = url.searchParams.get('tagOp') === 'OR' ? 'OR' : 'AND';
|
||||
// Narrow the accepted truthy surface to exactly "true" (mirrors the tagOp clamp).
|
||||
const undated = url.searchParams.get('undated') === 'true';
|
||||
const page = Math.max(0, Number(url.searchParams.get('page') ?? '0') || 0);
|
||||
|
||||
const api = createApiClient(fetch);
|
||||
@@ -66,6 +68,7 @@ export async function load({ url, fetch }) {
|
||||
tag: tags.length ? tags : undefined,
|
||||
tagQ: tagQ && !tags.length ? tagQ : undefined,
|
||||
tagOp: tagOp === 'OR' ? 'OR' : undefined,
|
||||
undated: undated || undefined,
|
||||
sort,
|
||||
dir: dir || undefined,
|
||||
page,
|
||||
@@ -94,6 +97,7 @@ export async function load({ url, fetch }) {
|
||||
dir,
|
||||
tagQ,
|
||||
tagOp,
|
||||
undated,
|
||||
error: 'Daten konnten nicht geladen werden.' as string | null
|
||||
};
|
||||
}
|
||||
@@ -124,6 +128,7 @@ export async function load({ url, fetch }) {
|
||||
dir,
|
||||
tagQ,
|
||||
tagOp,
|
||||
undated,
|
||||
error: errorMessage
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user