From 44a86f0b0fb627a436c31206128779619844fb25 Mon Sep 17 00:00:00 2001 From: seaznCode Date: Wed, 22 Apr 2026 20:27:56 +0200 Subject: [PATCH] fix: ensure invoice downloads as PDF regardless of URL type --- src/app/profile/components/financeInvoices.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/profile/components/financeInvoices.tsx b/src/app/profile/components/financeInvoices.tsx index 22ca016..7b7a5dc 100644 --- a/src/app/profile/components/financeInvoices.tsx +++ b/src/app/profile/components/financeInvoices.tsx @@ -113,8 +113,7 @@ export default function FinanceInvoices({ abonementId }: Props) { if (!res.ok) throw new Error(`Download failed: ${res.status}`) const blob = await res.blob() const invoiceNo = invoice.invoiceNumber || String(invoice.id) - const ext = invoice.pdfUrl ? 'pdf' : 'html' - downloadBlob(blob, `invoice-${invoiceNo}.${ext}`) + downloadBlob(blob, `invoice-${invoiceNo}.pdf`) } else { const blob = new Blob([JSON.stringify(invoice.raw, null, 2)], { type: 'application/json' }) downloadBlob(blob, `invoice-${invoice.invoiceNumber || invoice.id}.json`)