forked from forgejo/forgejo
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,7 +5,7 @@
|
|||
package repo
|
||||
|
||||
import (
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
api "code.gitea.io/sdk/gitea"
|
||||
|
||||
|
@ -21,7 +21,7 @@ import (
|
|||
// see https://github.com/gogits/go-gogs-client/wiki/Repositories#search-repositories
|
||||
func Search(ctx *context.APIContext) {
|
||||
opts := &models.SearchRepoOptions{
|
||||
Keyword: path.Base(ctx.Query("q")),
|
||||
Keyword: strings.Trim(ctx.Query("q"), " "),
|
||||
OwnerID: ctx.QueryInt64("uid"),
|
||||
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue