mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Remove AddParamIfExist(AddParam) (#29841)
Follow #29834 Remove AddParamIfExist, use "AddParamString" instead, it should clearly know what is being added into the parameters.
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
package admin
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
@@ -84,7 +85,7 @@ func UnadoptedRepos(ctx *context.Context) {
|
||||
if !doSearch {
|
||||
pager := context.NewPagination(0, opts.PageSize, opts.Page, 5)
|
||||
pager.SetDefaultParams(ctx)
|
||||
pager.AddParamIfExist("search", ctx.Data["search"])
|
||||
pager.AddParamString("search", fmt.Sprint(doSearch))
|
||||
ctx.Data["Page"] = pager
|
||||
ctx.HTML(http.StatusOK, tplUnadoptedRepos)
|
||||
return
|
||||
@@ -98,7 +99,7 @@ func UnadoptedRepos(ctx *context.Context) {
|
||||
ctx.Data["Dirs"] = repoNames
|
||||
pager := context.NewPagination(count, opts.PageSize, opts.Page, 5)
|
||||
pager.SetDefaultParams(ctx)
|
||||
pager.AddParamIfExist("search", ctx.Data["search"])
|
||||
pager.AddParamString("search", fmt.Sprint(doSearch))
|
||||
ctx.Data["Page"] = pager
|
||||
ctx.HTML(http.StatusOK, tplUnadoptedRepos)
|
||||
}
|
||||
|
Reference in New Issue
Block a user