refactor(knowledge): Standardize formatting and improve code readability

- Reformatted the API functions in the knowledge base module for consistent indentation and spacing.
- Enhanced overall code readability without altering functionality.
This commit is contained in:
Xia Dong
2026-01-14 19:04:55 +08:00
committed by begoniezhao
parent cec722aa43
commit 928d1c3d44
+2 -2
View File
@@ -28,7 +28,7 @@ export function getKnowledgeBaseById(id: string) {
} }
export function updateKnowledgeBase(id: string, data: { name: string; description?: string; config: any }) { export function updateKnowledgeBase(id: string, data: { name: string; description?: string; config: any }) {
return put(`/api/v1/knowledge-bases/${id}`, data); return put(`/api/v1/knowledge-bases/${id}` , data);
} }
export function deleteKnowledgeBase(id: string) { export function deleteKnowledgeBase(id: string) {
@@ -41,7 +41,7 @@ export function copyKnowledgeBase(data: { source_id: string; target_id?: string
// 知识文件 API(基于具体知识库) // 知识文件 API(基于具体知识库)
// data.tag_id: 可选,指定知识所属的分类ID // data.tag_id: 可选,指定知识所属的分类ID
export function uploadKnowledgeFile(kbId: string, data: { file: File; tag_id?: string;[key: string]: any } = { file: new File([], '') }, onProgress?: (progressEvent: any) => void) { export function uploadKnowledgeFile(kbId: string, data: { file: File; tag_id?: string; [key: string]: any } = { file: new File([], '') }, onProgress?: (progressEvent: any) => void) {
const formData = new FormData(); const formData = new FormData();
Object.keys(data).forEach(key => { Object.keys(data).forEach(key => {
if (data[key] !== undefined) formData.append(key, data[key]); if (data[key] !== undefined) formData.append(key, data[key]);