mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-30 19:08:37 +00: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:
		| @@ -163,8 +163,8 @@ func Graph(ctx *context.Context) { | ||||
| 	ctx.Data["CommitCount"] = commitsCount | ||||
|  | ||||
| 	paginator := context.NewPagination(int(graphCommitsCount), setting.UI.GraphMaxCommitNum, page, 5) | ||||
| 	paginator.AddParam(ctx, "mode", "Mode") | ||||
| 	paginator.AddParam(ctx, "hide-pr-refs", "HidePRRefs") | ||||
| 	paginator.AddParamIfExist("mode", ctx.Data["Mode"]) | ||||
| 	paginator.AddParamIfExist("hide-pr-refs", ctx.Data["HidePRRefs"]) | ||||
| 	for _, branch := range branches { | ||||
| 		paginator.AddParamString("branch", branch) | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user