Zeige E-Mail-Anlagen in der Leseansicht, damit der Inhalt nachvollziehbar bleibt.
Deploy Development / deploy (push) Successful in 29s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-17 19:53:35 +02:00
1 parent f0c8981e22
commit 2664021e7f
5 files changed
+124 -18

No files matched your search

+8 -3
View File
@@ -76,16 +76,21 @@ function mailQuery(context) {
return params;
}
export async function downloadMailPart(elementId, context, suffix, filename) {
export async function fetchMailPart(elementId, context, suffix) {
const response = await fetch(`/api/v1/external-refs/${elementId}/mail/${suffix}?${mailQuery(context)}`, {
credentials: "include",
headers: scopeHeaders(),
});
if (!response.ok) {
const data = await response.json().catch(() => null);
throw new Error(data?.detail || "Die vollständige E-Mail ist nicht verfügbar.");
const fallback = suffix === "original" ? "Die vollständige E-Mail ist nicht verfügbar." : "Die Anlage ist nicht verfügbar.";
throw new Error(data?.detail || fallback);
}
const blob = await response.blob();
return response.blob();
}
export async function downloadMailPart(elementId, context, suffix, filename) {
const blob = await fetchMailPart(elementId, context, suffix);
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;