From 05d183fe2c38cf77a40a7a0d259054ba5737ac18 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Sat, 28 Mar 2026 15:53:50 +0100 Subject: [PATCH] fix(billing): use full API_URL for PDF download endpoint --- lib/api/billing.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/api/billing.ts b/lib/api/billing.ts index 6dc3572..f915673 100644 --- a/lib/api/billing.ts +++ b/lib/api/billing.ts @@ -109,7 +109,8 @@ export async function getInvoices(): Promise { } export async function downloadInvoicePDF(invoiceId: string): Promise { - const res = await fetch('/api/billing/invoices/' + invoiceId + '/pdf', { + const { API_URL } = await import('./client') + const res = await fetch(API_URL + '/api/billing/invoices/' + invoiceId + '/pdf', { credentials: 'include', }) if (!res.ok) throw new Error('Failed to download invoice PDF')