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:
Jack
2026-04-28 17:09:23 +08:00
committed by GitHub
parent e6e80041f5
commit c330005659

View File

@@ -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(