mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-25 18:40:51 +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:
parent
e9fba18a26
commit
16dea6cebd
64 changed files with 504 additions and 441 deletions
|
@ -5,6 +5,7 @@
|
|||
package admin
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -53,7 +54,7 @@ func DeleteRepo(ctx *context.Context) {
|
|||
log.Trace("Repository deleted: %s", repo.FullName())
|
||||
|
||||
ctx.Flash.Success(ctx.Tr("repo.settings.deletion_success"))
|
||||
ctx.JSON(200, map[string]interface{}{
|
||||
ctx.JSON(http.StatusOK, map[string]interface{}{
|
||||
"redirect": setting.AppSubURL + "/admin/repos?page=" + ctx.Query("page") + "&sort=" + ctx.Query("sort"),
|
||||
})
|
||||
}
|
||||
|
@ -85,7 +86,7 @@ func UnadoptedRepos(ctx *context.Context) {
|
|||
pager.SetDefaultParams(ctx)
|
||||
pager.AddParam(ctx, "search", "search")
|
||||
ctx.Data["Page"] = pager
|
||||
ctx.HTML(200, tplUnadoptedRepos)
|
||||
ctx.HTML(http.StatusOK, tplUnadoptedRepos)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -99,7 +100,7 @@ func UnadoptedRepos(ctx *context.Context) {
|
|||
pager.SetDefaultParams(ctx)
|
||||
pager.AddParam(ctx, "search", "search")
|
||||
ctx.Data["Page"] = pager
|
||||
ctx.HTML(200, tplUnadoptedRepos)
|
||||
ctx.HTML(http.StatusOK, tplUnadoptedRepos)
|
||||
}
|
||||
|
||||
// AdoptOrDeleteRepository adopts or deletes a repository
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue