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

@@ -13,7 +13,7 @@ const {
getFile,
moveFile,
getDatasetDocumentFileDownload,
getDocumentFileDownload,
getAttachmentFileDownload,
} = api;
const methods = {
@@ -62,8 +62,8 @@ const fileManagerService = registerServer<keyof typeof methods>(
request,
);
export const downloadFile = (data: { docId: string; ext: string }) => {
return request.get(getDocumentFileDownload(data.docId), {
export const downloadAgentFile = (data: { docId: string; ext: string }) => {
return request.get(getAttachmentFileDownload(data.docId), {
params: { ext: data.ext },
responseType: 'blob',
});