mirror of
https://github.com/go-gitea/gitea
synced 2025-07-08 03:27:19 +00:00
Refactor names (#31405)
This PR only does "renaming": * `Route` should be `Router` (and chi router is also called "router") * `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`) * Use lower case for private functions to avoid exposing or abusing
This commit is contained in:
@ -30,7 +30,7 @@ func GitHooksEdit(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.settings.githooks")
|
||||
ctx.Data["PageIsSettingsGitHooks"] = true
|
||||
|
||||
name := ctx.Params(":name")
|
||||
name := ctx.PathParam(":name")
|
||||
hook, err := ctx.Repo.GitRepo.GetHook(name)
|
||||
if err != nil {
|
||||
if err == git.ErrNotValidHook {
|
||||
@ -46,7 +46,7 @@ func GitHooksEdit(ctx *context.Context) {
|
||||
|
||||
// GitHooksEditPost response for editing a git hook of a repository
|
||||
func GitHooksEditPost(ctx *context.Context) {
|
||||
name := ctx.Params(":name")
|
||||
name := ctx.PathParam(":name")
|
||||
hook, err := ctx.Repo.GitRepo.GetHook(name)
|
||||
if err != nil {
|
||||
if err == git.ErrNotValidHook {
|
||||
|
Reference in New Issue
Block a user