aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/shared
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-06-19 06:32:45 +0800
committerGitHub <noreply@github.com>2024-06-19 06:32:45 +0800
commit43c7a2e7b1c7fb8aa2347d82ad0a6886d6fad9c2 (patch)
treec98c2e1159ee02eb52282811f28a4c31ad222c67 /routers/api/v1/shared
parent17baf1af10de025a47ade1f16f1e5c51646d7fcf (diff)
downloadgitea-43c7a2e7b1c7fb8aa2347d82ad0a6886d6fad9c2.tar.gz
gitea-43c7a2e7b1c7fb8aa2347d82ad0a6886d6fad9c2.zip
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
Diffstat (limited to 'routers/api/v1/shared')
-rw-r--r--routers/api/v1/shared/block.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/shared/block.go b/routers/api/v1/shared/block.go
index a1e65625ed..490a48f81c 100644
--- a/routers/api/v1/shared/block.go
+++ b/routers/api/v1/shared/block.go
@@ -40,7 +40,7 @@ func ListBlocks(ctx *context.APIContext, blocker *user_model.User) {
}
func CheckUserBlock(ctx *context.APIContext, blocker *user_model.User) {
- blockee, err := user_model.GetUserByName(ctx, ctx.Params("username"))
+ blockee, err := user_model.GetUserByName(ctx, ctx.PathParam("username"))
if err != nil {
ctx.NotFound("GetUserByName", err)
return
@@ -60,7 +60,7 @@ func CheckUserBlock(ctx *context.APIContext, blocker *user_model.User) {
}
func BlockUser(ctx *context.APIContext, blocker *user_model.User) {
- blockee, err := user_model.GetUserByName(ctx, ctx.Params("username"))
+ blockee, err := user_model.GetUserByName(ctx, ctx.PathParam("username"))
if err != nil {
ctx.NotFound("GetUserByName", err)
return
@@ -79,7 +79,7 @@ func BlockUser(ctx *context.APIContext, blocker *user_model.User) {
}
func UnblockUser(ctx *context.APIContext, doer, blocker *user_model.User) {
- blockee, err := user_model.GetUserByName(ctx, ctx.Params("username"))
+ blockee, err := user_model.GetUserByName(ctx, ctx.PathParam("username"))
if err != nil {
ctx.NotFound("GetUserByName", err)
return