aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/milestone.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/repo/milestone.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/repo/milestone.go')
-rw-r--r--routers/api/v1/repo/milestone.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/repo/milestone.go b/routers/api/v1/repo/milestone.go
index 5a250dbd80..db86d0868f 100644
--- a/routers/api/v1/repo/milestone.go
+++ b/routers/api/v1/repo/milestone.go
@@ -215,7 +215,7 @@ func EditMilestone(ctx *context.APIContext, form api.EditMilestoneOption) {
}
if err := models.UpdateMilestone(milestone, oldIsClosed); err != nil {
- ctx.ServerError("UpdateMilestone", err)
+ ctx.Error(http.StatusInternalServerError, "UpdateMilestone", err)
return
}
ctx.JSON(http.StatusOK, convert.ToAPIMilestone(milestone))