mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-26 02:13:29 +08:00
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:
@@ -1,6 +1,6 @@
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { IDocumentDownloadInfo } from '@/interfaces/database/chat';
|
||||
import { downloadFile } from '@/services/file-manager-service';
|
||||
import { downloadAgentFile } from '@/services/file-manager-service';
|
||||
import { downloadFileFromBlob } from '@/utils/file-util';
|
||||
import { Download, FileText } from 'lucide-react';
|
||||
import { useCallback } from 'react';
|
||||
@@ -20,7 +20,7 @@ export function DocumentDownloadButton({
|
||||
try {
|
||||
const ext =
|
||||
downloadInfo.filename.split('.').pop()?.toLowerCase() || 'bin';
|
||||
const response = await downloadFile({
|
||||
const response = await downloadAgentFile({
|
||||
docId: downloadInfo.doc_id,
|
||||
ext,
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import { useSetModalState } from '@/hooks/common-hooks';
|
||||
import { IRemoveMessageById } from '@/hooks/logic-hooks';
|
||||
import { AgentChatContext } from '@/pages/agent/context';
|
||||
import { downloadFile } from '@/services/file-manager-service';
|
||||
import { downloadAgentFile } from '@/services/file-manager-service';
|
||||
import { downloadFileFromBlob } from '@/utils/file-util';
|
||||
import {
|
||||
DeleteOutlined,
|
||||
@@ -125,7 +125,7 @@ export const AssistantGroupButton = ({
|
||||
value="g"
|
||||
onClick={async () => {
|
||||
try {
|
||||
const response = await downloadFile({
|
||||
const response = await downloadAgentFile({
|
||||
docId: attachment.doc_id,
|
||||
ext: attachment.format,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user