Skip to content

Commit aa42c6f

Browse files
committed
feat: add API method for replacing source files in documents
1 parent 620d4ff commit aa42c6f

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

ui/src/api/system-resource-management/document.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ const getDownloadSourceFile: (knowledge_id: string, document_id: string, documen
134134
return exportFile(document_name, `${prefix}/${knowledge_id}/document/${document_id}/download_source_file`, {}, undefined)
135135
}
136136

137+
const postReplaceSourceFile: (knowledge_id: string, document_id: string, data: any) => Promise<Result<any>> = (
138+
knowledge_id,
139+
document_id,
140+
data,
141+
) => {
142+
return post(`${prefix}/${knowledge_id}/document/${document_id}/replace_source_file`, data, {}, undefined)
143+
}
144+
145+
146+
137147
/**
138148
* 导出文档
139149
* @param document_name 文档名称
@@ -567,6 +577,7 @@ export default {
567577
putBatchCancelTask,
568578
putCancelTask,
569579
getDownloadSourceFile,
580+
postReplaceSourceFile,
570581
exportDocument,
571582
exportDocumentZip,
572583
putDocumentRefresh,

ui/src/api/system-shared/document.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,16 @@ const getDownloadSourceFile: (knowledge_id: string, document_id: string, documen
134134
return exportFile(document_name, `${prefix}/${knowledge_id}/document/${document_id}/download_source_file`, {}, undefined)
135135
}
136136

137+
const postReplaceSourceFile: (knowledge_id: string, document_id: string, data: any) => Promise<Result<any>> = (
138+
knowledge_id,
139+
document_id,
140+
data,
141+
) => {
142+
return post(`${prefix}/${knowledge_id}/document/${document_id}/replace_source_file`, data, {}, undefined)
143+
}
144+
145+
146+
137147
/**
138148
* 导出文档
139149
* @param document_name 文档名称
@@ -568,6 +578,7 @@ export default {
568578
putBatchCancelTask,
569579
putCancelTask,
570580
getDownloadSourceFile,
581+
postReplaceSourceFile,
571582
exportDocument,
572583
exportDocumentZip,
573584
putDocumentRefresh,

0 commit comments

Comments
 (0)