mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: add API method for replacing source files in documents
This commit is contained in:
parent
620d4ff996
commit
aa42c6f76f
|
|
@ -134,6 +134,16 @@ const getDownloadSourceFile: (knowledge_id: string, document_id: string, documen
|
|||
return exportFile(document_name, `${prefix}/${knowledge_id}/document/${document_id}/download_source_file`, {}, undefined)
|
||||
}
|
||||
|
||||
const postReplaceSourceFile: (knowledge_id: string, document_id: string, data: any) => Promise<Result<any>> = (
|
||||
knowledge_id,
|
||||
document_id,
|
||||
data,
|
||||
) => {
|
||||
return post(`${prefix}/${knowledge_id}/document/${document_id}/replace_source_file`, data, {}, undefined)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导出文档
|
||||
* @param document_name 文档名称
|
||||
|
|
@ -567,6 +577,7 @@ export default {
|
|||
putBatchCancelTask,
|
||||
putCancelTask,
|
||||
getDownloadSourceFile,
|
||||
postReplaceSourceFile,
|
||||
exportDocument,
|
||||
exportDocumentZip,
|
||||
putDocumentRefresh,
|
||||
|
|
|
|||
|
|
@ -134,6 +134,16 @@ const getDownloadSourceFile: (knowledge_id: string, document_id: string, documen
|
|||
return exportFile(document_name, `${prefix}/${knowledge_id}/document/${document_id}/download_source_file`, {}, undefined)
|
||||
}
|
||||
|
||||
const postReplaceSourceFile: (knowledge_id: string, document_id: string, data: any) => Promise<Result<any>> = (
|
||||
knowledge_id,
|
||||
document_id,
|
||||
data,
|
||||
) => {
|
||||
return post(`${prefix}/${knowledge_id}/document/${document_id}/replace_source_file`, data, {}, undefined)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 导出文档
|
||||
* @param document_name 文档名称
|
||||
|
|
@ -568,6 +578,7 @@ export default {
|
|||
putBatchCancelTask,
|
||||
putCancelTask,
|
||||
getDownloadSourceFile,
|
||||
postReplaceSourceFile,
|
||||
exportDocument,
|
||||
exportDocumentZip,
|
||||
putDocumentRefresh,
|
||||
|
|
|
|||
Loading…
Reference in New Issue