fix: move agent attachment download api (#15146)

### What problem does this PR solve?

move agent attachment download api to the correct route and update
frontend callers

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

### Notes

- Move the attachment download endpoint from document routes to agent
routes.
- Update frontend download callers to use the agent attachment endpoint.
- Reuse the shared file response header helper instead of duplicating it
in `agent_api.py`.
This commit is contained in:
buua436
2026-05-22 15:22:05 +08:00
committed by GitHub
parent ed04893415
commit 71a52d579c
7 changed files with 150 additions and 159 deletions

View File

@@ -129,8 +129,6 @@ export default {
`${restAPIv1}/datasets/${datasetId}/documents/${documentId}`,
documentThumbnails: `${restAPIv1}/thumbnails`,
getDocumentFile: `${restAPIv1}/documents`,
getDocumentFileDownload: (docId: string) =>
`${restAPIv1}/documents/${docId}/download`,
documentUpload: (datasetId: string) =>
`${restAPIv1}/datasets/${datasetId}/documents`,
webCrawl: (datasetId: string) =>
@@ -223,6 +221,8 @@ export default {
`${restAPIv1}/agentbots/${canvasId}/inputs`,
prompt: `${restAPIv1}/agents/prompts`,
cancelDataflow: (id: string) => `${restAPIv1}/tasks/${id}/cancel`,
getAttachmentFileDownload: (docId: string) =>
`${restAPIv1}/agents/${docId}/download`,
downloadFile: `${restAPIv1}/agents/download`,
testWebhook: (id: string) => `${restAPIv1}/agents/${id}/webhook/test`,
fetchWebhookTrace: (id: string) => `${restAPIv1}/agents/${id}/webhook/logs`,