Fix user search paging
When searching for users, page the results by default, and respect the default paging limits. This makes queries like '/api/v1/users/search?limit=1' actually work. Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
This commit is contained in:
parent
387e63e6f6
commit
9b85f97835
2 changed files with 22 additions and 1 deletions
|
@ -140,7 +140,7 @@ func SearchUsers(ctx context.Context, opts *SearchUserOptions) (users []*User, _
|
|||
|
||||
sessQuery := opts.toSearchQueryBase(ctx).OrderBy(opts.OrderBy.String())
|
||||
defer sessQuery.Close()
|
||||
if opts.Page != 0 {
|
||||
if opts.PageSize > 0 {
|
||||
sessQuery = db.SetSessionPagination(sessQuery, opts)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue