Skip to content

Commit

Permalink
Fix pagination on /notifications/watching (#23564)
Browse files Browse the repository at this point in the history
The `q` parameter was not rendered in pagination links because
`context.Pagination:AddParam` checks for existance of the parameter in
`ctx.Data` where it was absent. Added the parameter there to fix it.
  • Loading branch information
silverwind committed Mar 21, 2023
1 parent 6250fe1 commit 45aa4ea
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routers/web/user/notification.go
Expand Up @@ -344,6 +344,9 @@ func NotificationWatching(ctx *context.Context) {
page = 1
}

keyword := ctx.FormTrim("q")
ctx.Data["Keyword"] = keyword

var orderBy db.SearchOrderBy
ctx.Data["SortType"] = ctx.FormString("sort")
switch ctx.FormString("sort") {
Expand Down Expand Up @@ -378,7 +381,7 @@ func NotificationWatching(ctx *context.Context) {
Page: page,
},
Actor: ctx.Doer,
Keyword: ctx.FormTrim("q"),
Keyword: keyword,
OrderBy: orderBy,
Private: ctx.IsSigned,
WatchedByID: ctx.Doer.ID,
Expand Down

0 comments on commit 45aa4ea

Please sign in to comment.