fix(#177): PDF-Endpoint auf /drafts/pdf/{id} (Routing-Konflikt mit {draft_id:int})

This commit is contained in:
Dotty Dotter 2026-05-06 16:06:57 +02:00
parent d8d7c3f02f
commit 4bb267aace
2 changed files with 2 additions and 2 deletions

View File

@ -2251,7 +2251,7 @@ async def api_draft_detail(draft_id: int):
return d
@app.get("/api/aktuelle-themen/drafts/{draft_id}.pdf")
@app.get("/api/aktuelle-themen/drafts/pdf/{draft_id}")
async def api_draft_pdf(draft_id: int):
"""PM-Entwurf als PDF (WeasyPrint, Phase 4.1)."""
from fastapi.responses import Response

View File

@ -661,7 +661,7 @@ async function showDraftFromData(d) {
${isMailtoTooLong ? '<span style="font-family:var(--font-mono);font-size:10px;opacity:0.6;">PM zu lang für Mail-Link — Clipboard nutzen.</span>'
: `<a href="${mailto}" style="font-family:var(--font-mono);font-size:11px;padding:5px 12px;border:1px solid var(--ecg-border);border-radius:3px;background:var(--ecg-card-bg);color:var(--ecg-dark);text-decoration:none;">📧 Per Mail versenden</a>`}
<button type="button" onclick="copyDraftToClipboard(this, ${JSON.stringify(d.titel).replace(/"/g, '&quot;')}, ${JSON.stringify(d.body).replace(/"/g, '&quot;')})" style="font-family:var(--font-mono);font-size:11px;padding:5px 12px;border:1px solid var(--ecg-border);border-radius:3px;background:var(--ecg-card-bg);color:var(--ecg-dark);cursor:pointer;">📋 In Zwischenablage kopieren</button>
<a href="/api/aktuelle-themen/drafts/${d.id}.pdf" target="_blank" rel="noopener" style="font-family:var(--font-mono);font-size:11px;padding:5px 12px;border:1px solid var(--ecg-border);border-radius:3px;background:var(--ecg-card-bg);color:var(--ecg-dark);text-decoration:none;">📄 PDF</a>
<a href="/api/aktuelle-themen/drafts/pdf/${d.id}" target="_blank" rel="noopener" style="font-family:var(--font-mono);font-size:11px;padding:5px 12px;border:1px solid var(--ecg-border);border-radius:3px;background:var(--ecg-card-bg);color:var(--ecg-dark);text-decoration:none;">📄 PDF</a>
</div>`;
document.getElementById('at-modal-body').innerHTML =