mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
Fix: document level auto metadata config missing after save (#14421)
### What problem does this PR solve? Steps to re-produce (existing bug before API migration): create a new dataset upload a file click on "General" in "Parse" column and then click on "switch or configure ingestion pipeline" click on "Settings" (at right of "Auto metadata") click "Add" to add new metadata click on "Save" re-open "Settings" and the newly added metadata is not there ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -432,13 +432,13 @@ export const useManageMetaDataModal = (
|
||||
);
|
||||
|
||||
const handleSaveSingleFileSettings = useCallback(
|
||||
async (callback: () => void) => {
|
||||
async (callback: () => void, builtInMetadata?: IBuiltInMetadataItem[]) => {
|
||||
const data = util.tableDataToMetaDataSettingJSON(tableData);
|
||||
if (otherData?.documentId) {
|
||||
const { data: res } = await updateDocumentMetaDataConfig({
|
||||
kb_id: id || '',
|
||||
doc_id: otherData.documentId,
|
||||
data: { metadata: data },
|
||||
data: { metadata: data, builtInMetadata: builtInMetadata || [] },
|
||||
});
|
||||
if (res.code === 0) {
|
||||
message.success(t('message.operated'));
|
||||
@@ -446,9 +446,12 @@ export const useManageMetaDataModal = (
|
||||
}
|
||||
}
|
||||
|
||||
return data;
|
||||
return {
|
||||
metadata: data,
|
||||
builtInMetadata: builtInMetadata || [],
|
||||
};
|
||||
},
|
||||
[tableData, t, otherData],
|
||||
[tableData, t, otherData, id],
|
||||
);
|
||||
|
||||
const handleSave = useCallback(
|
||||
|
||||
Reference in New Issue
Block a user