diff options
author | Morlinest <morlinest@gmail.com> | 2017-10-26 23:16:13 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-10-27 00:16:13 +0300 |
commit | ddb7f59ef414ffad8dc2485055c246aaea0507d7 (patch) | |
tree | 1e0f10f02b05896a43f609dd91a29d727e1b4a2a /routers/user/profile.go | |
parent | 4d01ecaef350c6df0c27913f05cc0537bed5f7e9 (diff) | |
download | gitea-ddb7f59ef414ffad8dc2485055c246aaea0507d7.tar.gz gitea-ddb7f59ef414ffad8dc2485055c246aaea0507d7.zip |
Add search mode option to /api/repo/search (#2756)
* Add repo type option to /api/repo/search
* Add tests and fix result of collaborative filter in specific condition
* Fix/optimize search & tests
* Improve integration tests
* Fix lint errors
* Fix unit tests
* Change and improve internal implementation of repo search
* Use NonexistentID
* Make search api more general
* Change mirror and fork search behaviour
* Fix tests & typo in comment
Diffstat (limited to 'routers/user/profile.go')
-rw-r--r-- | routers/user/profile.go | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/routers/user/profile.go b/routers/user/profile.go index b0eab09333..86819de251 100644 --- a/routers/user/profile.go +++ b/routers/user/profile.go @@ -15,6 +15,7 @@ import ( "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/setting" + "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/routers/repo" ) @@ -157,13 +158,14 @@ func Profile(ctx *context.Context) { } } else { repos, count, err = models.SearchRepositoryByName(&models.SearchRepoOptions{ - Keyword: keyword, - OwnerID: ctxUser.ID, - OrderBy: orderBy, - Private: showPrivate, - Page: page, - PageSize: setting.UI.User.RepoPagingNum, - Starred: true, + Keyword: keyword, + OwnerID: ctxUser.ID, + OrderBy: orderBy, + Private: showPrivate, + Page: page, + PageSize: setting.UI.User.RepoPagingNum, + Starred: true, + Collaborate: util.OptionalBoolFalse, }) if err != nil { ctx.Handle(500, "SearchRepositoryByName", err) @@ -199,14 +201,13 @@ func Profile(ctx *context.Context) { ctx.Data["Total"] = total } else { repos, count, err = models.SearchRepositoryByName(&models.SearchRepoOptions{ - Keyword: keyword, - OwnerID: ctxUser.ID, - OrderBy: orderBy, - Private: showPrivate, - Page: page, - IsProfile: true, - PageSize: setting.UI.User.RepoPagingNum, - Collaborate: true, + Keyword: keyword, + OwnerID: ctxUser.ID, + OrderBy: orderBy, + Private: showPrivate, + Page: page, + IsProfile: true, + PageSize: setting.UI.User.RepoPagingNum, }) if err != nil { ctx.Handle(500, "SearchRepositoryByName", err) |