feat(knowledgeBase): Refactor document list API and improve polling logic
- Update getDocumentList API to accept kb_id as separate parameter instead of extracting from query object - Fix parameter name from auto_question to auto_questions in parser config - Add progress field initialization in document update params - Improve polling logic to handle both auto-return and manual stay scenarios with proper loading state management - Add console logging for debugging polling status and document processing - Reduce polling interval from 5000ms to 3000ms for faster status updates - Enhance cleanup logic with route change detection to prevent memory leaks - Add record parameter to progress render function for better data access - Refactor confirm dialog callbacks to properly manage loading state timing - Ensure loading indicator displays correctly when user chooses to stay on page
This commit is contained in:
@@ -199,8 +199,8 @@ export const deleteFile = async (id: string) => {
|
||||
};
|
||||
|
||||
// 获取文档列表
|
||||
export const getDocumentList = async (query: PathQuery) => {
|
||||
const response = await request.get(`${apiPrefix}/documents/${query.kb_id}/documents`, query);
|
||||
export const getDocumentList = async (kb_id:string, query: PathQuery) => {
|
||||
const response = await request.get(`${apiPrefix}/documents/${kb_id}/documents`, query);
|
||||
return response as KnowledgeBaseDocumentData[];
|
||||
};
|
||||
// 文档详情
|
||||
|
||||
Reference in New Issue
Block a user