aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/org/label.go
diff options
context:
space:
mode:
author赵智超 <1012112796@qq.com>2020-09-21 04:20:14 +0800
committerGitHub <noreply@github.com>2020-09-20 21:20:14 +0100
commitfec152155543e72f2e03885d431642887ce09d69 (patch)
tree6ba0d440eec9df315c8acf487918036717cf98f0 /routers/api/v1/org/label.go
parente7ffc67ad5add193e90219a856935bf643b33fe1 (diff)
downloadgitea-fec152155543e72f2e03885d431642887ce09d69.tar.gz
gitea-fec152155543e72f2e03885d431642887ce09d69.zip
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>
Diffstat (limited to 'routers/api/v1/org/label.go')
-rw-r--r--routers/api/v1/org/label.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/org/label.go b/routers/api/v1/org/label.go
index b4a8a5ac33..9a8a4fa291 100644
--- a/routers/api/v1/org/label.go
+++ b/routers/api/v1/org/label.go
@@ -201,7 +201,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))