1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Rename context.Query to context.Form (#16562)

This commit is contained in:
Lunny Xiao
2021-07-29 09:42:15 +08:00
committed by GitHub
parent 3705168837
commit 33e0b38287
85 changed files with 393 additions and 396 deletions

View File

@@ -143,15 +143,15 @@ func Profile(ctx *context.Context) {
ctx.Data["Orgs"] = orgs
ctx.Data["HasOrgsVisible"] = models.HasOrgsVisible(orgs, ctx.User)
tab := ctx.Query("tab")
tab := ctx.Form("tab")
ctx.Data["TabName"] = tab
page := ctx.QueryInt("page")
page := ctx.FormInt("page")
if page <= 0 {
page = 1
}
topicOnly := ctx.QueryBool("topic")
topicOnly := ctx.FormBool("topic")
var (
repos []*models.Repository
@@ -160,8 +160,8 @@ func Profile(ctx *context.Context) {
orderBy models.SearchOrderBy
)
ctx.Data["SortType"] = ctx.Query("sort")
switch ctx.Query("sort") {
ctx.Data["SortType"] = ctx.Form("sort")
switch ctx.Form("sort") {
case "newest":
orderBy = models.SearchOrderByNewest
case "oldest":
@@ -187,7 +187,7 @@ func Profile(ctx *context.Context) {
orderBy = models.SearchOrderByRecentUpdated
}
keyword := strings.Trim(ctx.Query("q"), " ")
keyword := strings.Trim(ctx.Form("q"), " ")
ctx.Data["Keyword"] = keyword
switch tab {
case "followers":
@@ -220,7 +220,7 @@ func Profile(ctx *context.Context) {
IncludePrivate: showPrivate,
OnlyPerformedBy: true,
IncludeDeleted: false,
Date: ctx.Query("date"),
Date: ctx.Form("date"),
})
if ctx.Written() {
return
@@ -332,5 +332,5 @@ func Action(ctx *context.Context) {
return
}
ctx.RedirectToFirst(ctx.Query("redirect_to"), u.HomeLink())
ctx.RedirectToFirst(ctx.Form("redirect_to"), u.HomeLink())
}