Fix: code-rabbit review comment (#16940)

This commit is contained in:
Lynn
2026-07-15 15:44:08 +08:00
committed by GitHub
parent 166ed3c159
commit 63c010cd04
3 changed files with 213 additions and 26 deletions

View File

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