mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +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:
@@ -90,7 +90,7 @@ func MembersAction(ctx *context.Context) {
|
||||
|
||||
org := ctx.Org.Organization
|
||||
|
||||
switch ctx.Params(":action") {
|
||||
switch ctx.PathParam(":action") {
|
||||
case "private":
|
||||
if ctx.Doer.ID != member.ID && !ctx.Org.IsOwner {
|
||||
ctx.Error(http.StatusNotFound)
|
||||
@@ -131,7 +131,7 @@ func MembersAction(ctx *context.Context) {
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
log.Error("Action(%s): %v", ctx.Params(":action"), err)
|
||||
log.Error("Action(%s): %v", ctx.PathParam(":action"), err)
|
||||
ctx.JSON(http.StatusOK, map[string]any{
|
||||
"ok": false,
|
||||
"err": err.Error(),
|
||||
@@ -140,7 +140,7 @@ func MembersAction(ctx *context.Context) {
|
||||
}
|
||||
|
||||
redirect := ctx.Org.OrgLink + "/members"
|
||||
if ctx.Params(":action") == "leave" {
|
||||
if ctx.PathParam(":action") == "leave" {
|
||||
redirect = setting.AppSubURL + "/"
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user