feat(knowledge): refactor knowledge creation form and improve form handling

This commit is contained in:
2025-10-16 18:52:20 +08:00
parent f4e2f4f10c
commit 50628816e3
5 changed files with 312 additions and 150 deletions

View File

@@ -272,7 +272,9 @@ export const useKnowledgeOperations = () => {
* 更新知识库基础信息
* 包括名称、描述、语言等基本信息
*/
const updateKnowledgeBasicInfo = useCallback(async (data: IKnowledge) => {
const updateKnowledgeBasicInfo = useCallback(async (data: {
kb_id: string;
} & Partial<IKnowledge>) => {
try {
setLoading(true);
setError(null);
@@ -300,10 +302,7 @@ export const useKnowledgeOperations = () => {
*/
const updateKnowledgeModelConfig = useCallback(async (data: {
kb_id: string;
embd_id?: string;
parser_config?: Partial<IParserConfig>;
parser_id?: string;
}) => {
} & Partial<IKnowledge>) => {
try {
setLoading(true);
setError(null);