feat(stellungnahme): Einwendungs-Assistent für Windvorranggebiete
5-Schritt-Wizard: Gebietskontext → Argumente wählen → Ausgabeform → persönliche Betroffenheit → Absender + Ausgabe. Alle Eingaben bleiben lokal im Browser (kein Server-Transfer). Fertigtext- und Leitfaden-Modus. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -749,6 +749,32 @@ export async function getTextFragmentBySlug(
|
||||
});
|
||||
}
|
||||
|
||||
/** Alle Text-Fragmente, die einen bestimmten Tag (Slug) tragen. */
|
||||
export async function getTextFragmentsByTag(
|
||||
tagSlug: string,
|
||||
options?: { locale?: string },
|
||||
): Promise<TextFragmentEntry[]> {
|
||||
const key = `text_fragment:tag:${tagSlug}:${options?.locale ?? ""}`;
|
||||
return cached("text_fragment", key, async () => {
|
||||
const base = getBaseUrl();
|
||||
const url = new URL(`${base}/api/content/text_fragment`);
|
||||
url.searchParams.set("_per_page", "500");
|
||||
url.searchParams.set("_resolve", "tags");
|
||||
if (options?.locale) url.searchParams.set("_locale", options.locale);
|
||||
const res = await cmsFetch(url.toString());
|
||||
if (!res.ok) return [];
|
||||
const data = (await res.json()) as { items?: TextFragmentEntry[] };
|
||||
const items = data.items ?? [];
|
||||
return items.filter((f) => {
|
||||
const tags = (f as unknown as { tags?: unknown[] }).tags ?? [];
|
||||
return tags.some((t) => {
|
||||
if (typeof t === "string") return t === tagSlug;
|
||||
return (t as { _slug?: string })?._slug === tagSlug;
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/** Fullwidth-Banner (z. B. für Top-Banner mit Bild). */
|
||||
export type TopBannerEntry = components["schemas"]["top_banner"];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user