Invoice list with VAT breakdown and PDF download #72

Merged
uz1mani merged 2 commits from staging into main 2026-03-28 15:40:01 +00:00
2 changed files with 51 additions and 20 deletions
Showing only changes of commit 05d183fe2c - Show all commits

View File

@@ -109,7 +109,8 @@ export async function getInvoices(): Promise<Invoice[]> {
} }
export async function downloadInvoicePDF(invoiceId: string): Promise<void> { 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', credentials: 'include',
}) })
if (!res.ok) throw new Error('Failed to download invoice PDF') if (!res.ok) throw new Error('Failed to download invoice PDF')