feat(report): add getReportDownloadUrl helper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ubuntu 2026-04-26 00:14:04 +00:00
parent 7daf8566ed
commit 7cd876bfbe
1 changed files with 11 additions and 0 deletions

View File

@ -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}`
}