mirror of
https://github.com/go-gitea/gitea
synced 2025-07-15 23:17: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:
@@ -38,7 +38,7 @@ func GetAllEmails(ctx *context.APIContext) {
|
||||
listOptions := utils.GetListOptions(ctx)
|
||||
|
||||
emails, maxResults, err := user_model.SearchEmails(ctx, &user_model.SearchEmailOptions{
|
||||
Keyword: ctx.Params(":email"),
|
||||
Keyword: ctx.PathParam(":email"),
|
||||
ListOptions: listOptions,
|
||||
})
|
||||
if err != nil {
|
||||
@@ -82,6 +82,6 @@ func SearchEmail(ctx *context.APIContext) {
|
||||
// "403":
|
||||
// "$ref": "#/responses/forbidden"
|
||||
|
||||
ctx.SetParams(":email", ctx.FormTrim("q"))
|
||||
ctx.SetPathParam(":email", ctx.FormTrim("q"))
|
||||
GetAllEmails(ctx)
|
||||
}
|
||||
|
Reference in New Issue
Block a user