diff options
author | silverwind <me@silverwind.io> | 2023-03-21 02:07:14 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-20 21:07:14 -0400 |
commit | 45aa4ea7056f5a6cd286715596b64f4163588cd8 (patch) | |
tree | d5d593780ddb9599d2827f1acea99f189805b1e1 /routers | |
parent | 6250fe1dc15eccc18cdc4261e354c1c77f0a7fca (diff) | |
download | gitea-45aa4ea7056f5a6cd286715596b64f4163588cd8.tar.gz gitea-45aa4ea7056f5a6cd286715596b64f4163588cd8.zip |
Fix pagination on `/notifications/watching` (#23564)
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.
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/user/notification.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/routers/web/user/notification.go b/routers/web/user/notification.go index e12b41e649..e0aa92879f 100644 --- a/routers/web/user/notification.go +++ b/routers/web/user/notification.go @@ -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") { @@ -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, |