diff --git a/frontend/src/pages/ReportsPage.tsx b/frontend/src/pages/ReportsPage.tsx index 8306993..be1caf3 100644 --- a/frontend/src/pages/ReportsPage.tsx +++ b/frontend/src/pages/ReportsPage.tsx @@ -54,8 +54,7 @@ export function ReportsPage() { const downloadReport = (reportId: number) => { const token = localStorage.getItem('access_token') - const url = `/api/reports/download/${reportId}` - api.get(url, { responseType: 'blob' }) + api.get(`/reports/download/${reportId}`, { responseType: 'blob' }) .then((res) => { const blob = new Blob([res.data as BlobPart], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', @@ -77,7 +76,7 @@ export function ReportsPage() { }) .catch(() => { if (token) { - window.open(`${url}?token=${encodeURIComponent(token)}`, '_blank') + window.open(`/api/reports/download/${reportId}?token=${encodeURIComponent(token)}`, '_blank') } }) }