feat: Implement partial update for document metadata, allowing merging of new values with existing ones. (#28390)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
GuanMu
2025-11-21 12:58:20 +08:00
committed by GitHub
parent 06466cb73a
commit 5f61ca5e6f
6 changed files with 185 additions and 16 deletions

View File

@@ -115,6 +115,7 @@ const useBatchEditDocumentMetadata = ({
return {
document_id: documentId,
metadata_list: newMetadataList,
partial_update: docIndex < 0,
}
})
return res

View File

@@ -25,7 +25,7 @@ export type MetadataItemInBatchEdit = MetadataItemWithValue & {
isMultipleValue?: boolean
}
export type MetadataBatchEditToServer = { document_id: string, metadata_list: MetadataItemWithValue[] }[]
export type MetadataBatchEditToServer = { document_id: string, metadata_list: MetadataItemWithValue[], partial_update?: boolean }[]
export enum UpdateType {
changeValue = 'changeValue',