From 7cd876bfbe1855a8ce6265d7686606847c6b9188 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sun, 26 Apr 2026 00:14:04 +0000 Subject: [PATCH] feat(report): add getReportDownloadUrl helper Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/api/report.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/frontend/src/api/report.js b/frontend/src/api/report.js index c89a67d8..25c56e5e 100644 --- a/frontend/src/api/report.js +++ b/frontend/src/api/report.js @@ -49,3 +49,14 @@ export const getReport = (reportId) => { export const chatWithReport = (data) => { return requestWithRetry(() => service.post('/api/report/chat', data), 3, 1000) } + +/** + * Build the direct download URL for a report. + * @param {string} reportId + * @param {'md'|'pdf'} format + * @returns {string} URL for direct download + */ +export const getReportDownloadUrl = (reportId, format = 'md') => { + const base = import.meta.env.VITE_API_BASE_URL || '' + return `${base}/api/report/${reportId}/download?format=${format}` +}