mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-19 06:01:05 +08:00
Fix: code-rabbit review comment (#16940)
This commit is contained in:
@@ -572,6 +572,11 @@ func (h *ProviderHandler) AlterModel(c *gin.Context) {
|
||||
updateDict["extra"] = req.Extra
|
||||
}
|
||||
|
||||
if len(updateDict) == 0 {
|
||||
common.ResponseWithHttpCodeData(c, http.StatusBadRequest, common.CodeBadRequest, nil, "at least one update field is required besides model_name or model_id")
|
||||
return
|
||||
}
|
||||
|
||||
code, err := h.modelProviderService.AlterModel(providerName, instanceName, modelName, userID, modelID, updateDict)
|
||||
if err != nil {
|
||||
common.ErrorWithCode(c, code, err.Error())
|
||||
|
||||
Reference in New Issue
Block a user