mirror of
https://github.com/go-gitea/gitea
synced 2025-07-20 17:28:37 +00:00
[refactor] replace int with httpStatusCodes (#15282)
* replace "200" (int) with "http.StatusOK" (const) * ctx.Error & ctx.HTML * ctx.JSON Part1 * ctx.JSON Part2 * ctx.JSON Part3
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"code.gitea.io/gitea/modules/base"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
@@ -19,6 +21,6 @@ func SwaggerV1Json(ctx *context.Context) {
|
||||
ctx.Resp.Header().Set("Content-Type", "application/json")
|
||||
if err := t.Execute(ctx.Resp, ctx.Data); err != nil {
|
||||
log.Error("%v", err)
|
||||
ctx.Error(500)
|
||||
ctx.Error(http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user