mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-09 18:13:10 +02:00
Refactor AddParam to AddParamIfExist (#29834)
When read the code: `pager.AddParam(ctx, "search", "search")`, the
question always comes: What is it doing? Where is the value from? Why
"search" / "search" ?
Now it is clear: `pager.AddParamIfExist("search", ctx.Data["search"])`
This commit is contained in:
1 parent
6ead30dbc4
commit
e0ea3811c4
17 files changed
+53
-54
No files matched your search
@@ -344,8 +344,8 @@ func NotificationSubscriptions(ctx *context.Context) {
|
||||
ctx.Redirect(fmt.Sprintf("/notifications/subscriptions?page=%d", pager.Paginater.Current()))
|
||||
return
|
||||
}
|
||||
pager.AddParam(ctx, "sort", "SortType")
|
||||
pager.AddParam(ctx, "state", "State")
|
||||
pager.AddParamIfExist("sort", ctx.Data["SortType"])
|
||||
pager.AddParamIfExist("state", ctx.Data["State"])
|
||||
ctx.Data["Page"] = pager
|
||||
|
||||
ctx.HTML(http.StatusOK, tplNotificationSubscriptions)
|
||||
|
||||
Reference in new issue
Block a user