forked from kevadesu/forgejo
Not using "ctx.ServerError" in api (#12907)
This function will render a whole html page which is not useful for API. Signed-off-by: a1012112796 <1012112796@qq.com>
This commit is contained in:
parent
e7ffc67ad5
commit
fec1521555
10 changed files with 26 additions and 28 deletions
|
@ -222,7 +222,7 @@ func EditLabel(ctx *context.APIContext, form api.EditLabelOption) {
|
|||
label.Description = *form.Description
|
||||
}
|
||||
if err := models.UpdateLabel(label); err != nil {
|
||||
ctx.ServerError("UpdateLabel", err)
|
||||
ctx.Error(http.StatusInternalServerError, "UpdateLabel", err)
|
||||
return
|
||||
}
|
||||
ctx.JSON(http.StatusOK, convert.ToLabel(label))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue