mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-21 09:21:15 +00:00
fix: trim the whitespaces for the search keyword (#893)
This commit is contained in:
parent
55f2059f71
commit
3576e1ee73
7 changed files with 14 additions and 11 deletions
|
@ -5,6 +5,8 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/Unknwon/com"
|
||||
|
||||
api "code.gitea.io/sdk/gitea"
|
||||
|
@ -16,7 +18,7 @@ import (
|
|||
// Search search users
|
||||
func Search(ctx *context.APIContext) {
|
||||
opts := &models.SearchUserOptions{
|
||||
Keyword: ctx.Query("q"),
|
||||
Keyword: strings.Trim(ctx.Query("q"), " "),
|
||||
Type: models.UserTypeIndividual,
|
||||
PageSize: com.StrTo(ctx.Query("limit")).MustInt(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue