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')