fix(billing): use full API_URL for PDF download endpoint

This commit is contained in:
Usman Baig
2026-03-28 15:53:50 +01:00
parent 9c5a47ff3a
commit 05d183fe2c

View File

@@ -109,7 +109,8 @@ export async function getInvoices(): Promise<Invoice[]> {
}
export async function downloadInvoicePDF(invoiceId: string): Promise<void> {
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')