aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/setting/deploy_key.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-07-26 14:04:01 +0800
committerGitHub <noreply@github.com>2023-07-26 06:04:01 +0000
commitdcd3a631288686a95cedbd4aa9cce245e896825d (patch)
treee8c726ec07c3cb54fc092d63d2713fee409ee7b4 /routers/web/repo/setting/deploy_key.go
parent338d03ce2f05fcc49a577b58a6cfa6beb7996fd1 (diff)
downloadgitea-dcd3a631288686a95cedbd4aa9cce245e896825d.tar.gz
gitea-dcd3a631288686a95cedbd4aa9cce245e896825d.zip
Move web JSON functions to web context and simplify code (#26132)
The JSONRedirect/JSONOK/JSONError functions were put into "Base" context incorrectly, it would cause abuse. Actually, they are for "web context" only, so, move them to the correct place. And by the way, use them to simplify old code: +75 -196
Diffstat (limited to 'routers/web/repo/setting/deploy_key.go')
-rw-r--r--routers/web/repo/setting/deploy_key.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/routers/web/repo/setting/deploy_key.go b/routers/web/repo/setting/deploy_key.go
index d08c51f5e5..577706d454 100644
--- a/routers/web/repo/setting/deploy_key.go
+++ b/routers/web/repo/setting/deploy_key.go
@@ -105,7 +105,5 @@ func DeleteDeployKey(ctx *context.Context) {
ctx.Flash.Success(ctx.Tr("repo.settings.deploy_key_deletion_success"))
}
- ctx.JSON(http.StatusOK, map[string]any{
- "redirect": ctx.Repo.RepoLink + "/settings/keys",
- })
+ ctx.JSONRedirect(ctx.Repo.RepoLink + "/settings/keys")
}