mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
fix: trim the whitespaces for the search keyword (#893)
This commit is contained in:
@@ -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(),
|
||||
}
|
||||
|
Reference in New Issue
Block a user