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

@@ -57,12 +57,12 @@ func Branches(ctx *context.Context) {
ctx.Data["PageIsViewCode"] = true
ctx.Data["PageIsBranches"] = true
page := ctx.QueryInt("page")
page := ctx.FormInt("page")
if page <= 1 {
page = 1
}
limit := ctx.QueryInt("limit")
limit := ctx.FormInt("limit")
if limit <= 0 || limit > setting.Git.BranchesRangeSize {
limit = setting.Git.BranchesRangeSize
}
@@ -84,7 +84,7 @@ func Branches(ctx *context.Context) {
// DeleteBranchPost responses for delete merged branch
func DeleteBranchPost(ctx *context.Context) {
defer redirect(ctx)
branchName := ctx.Query("name")
branchName := ctx.Form("name")
if err := repo_service.DeleteBranch(ctx.User, ctx.Repo.Repository, ctx.Repo.GitRepo, branchName); err != nil {
switch {
@@ -112,8 +112,8 @@ func DeleteBranchPost(ctx *context.Context) {
func RestoreBranchPost(ctx *context.Context) {
defer redirect(ctx)
branchID := ctx.QueryInt64("branch_id")
branchName := ctx.Query("name")
branchID := ctx.FormInt64("branch_id")
branchName := ctx.Form("name")
deletedBranch, err := ctx.Repo.Repository.GetDeletedBranchByID(branchID)
if err != nil {