mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-07 20:10:14 +08:00
fix(go-document): keep upload partial success data as array (#16661)
### Summary Keep `data` as the uploaded document array when dataset document upload partially succeeds. This matches the Python API behavior and allows parse-on-creation to run for successfully uploaded files when other files in the same folder are unsupported.
This commit is contained in:
@@ -912,7 +912,7 @@ func (h *DocumentHandler) uploadLocalDocuments(c *gin.Context, kb *entity.Knowle
|
||||
|
||||
if strings.ToLower(c.DefaultQuery("return_raw_files", "false")) == "true" {
|
||||
if len(errMsgs) > 0 {
|
||||
common.SuccessNoMessage(c, gin.H{"documents": data, "errors": errMsgs})
|
||||
common.ResponseWithCodeData(c, common.CodeServerError, data, strings.Join(errMsgs, "\n"))
|
||||
return
|
||||
}
|
||||
common.SuccessNoMessage(c, data)
|
||||
@@ -923,7 +923,7 @@ func (h *DocumentHandler) uploadLocalDocuments(c *gin.Context, kb *entity.Knowle
|
||||
mapped[i] = mapDocKeysWithRunStatus(d)
|
||||
}
|
||||
if len(errMsgs) > 0 {
|
||||
common.SuccessNoMessage(c, gin.H{"documents": mapped, "errors": errMsgs})
|
||||
common.ResponseWithCodeData(c, common.CodeServerError, mapped, strings.Join(errMsgs, "\n"))
|
||||
return
|
||||
}
|
||||
common.SuccessNoMessage(c, mapped)
|
||||
|
||||
Reference in New Issue
Block a user