mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-24 09:26:48 +08:00
fix(file2document): batch link should add to existing KBs, not replace them (#17172)
This commit is contained in:
@@ -559,7 +559,13 @@ func (h *FileHandler) LinkToDatasets(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if err := h.file2DocumentService.LinkToDatasets(user.ID, &req); err != nil {
|
||||
mode := strings.ToLower(c.DefaultQuery("mode", "replace"))
|
||||
if mode != "add" && mode != "replace" {
|
||||
common.ResponseWithCodeData(c, common.CodeArgumentError, nil, "mode must be 'add' or 'replace'")
|
||||
return
|
||||
}
|
||||
|
||||
if err := h.file2DocumentService.LinkToDatasets(user.ID, &req, mode); err != nil {
|
||||
common.ResponseWithCodeData(c, linkToDatasetsErrorCode(err), nil, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user