summaryrefslogtreecommitdiffstats
path: root/models/repo_list.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo_list.go')
-rw-r--r--models/repo_list.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/repo_list.go b/models/repo_list.go
index 355b801a7e..de3562a2ab 100644
--- a/models/repo_list.go
+++ b/models/repo_list.go
@@ -138,6 +138,7 @@ type SearchRepoOptions struct {
Keyword string
OwnerID int64
PriorityOwnerID int64
+ TeamID int64
OrderBy SearchOrderBy
Private bool // Include private repositories in results
StarredByID int64
@@ -294,6 +295,10 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
cond = cond.And(accessCond)
}
+ if opts.TeamID > 0 {
+ cond = cond.And(builder.In("`repository`.id", builder.Select("`team_repo`.repo_id").From("team_repo").Where(builder.Eq{"`team_repo`.team_id": opts.TeamID})))
+ }
+
if opts.Keyword != "" {
// separate keyword
var subQueryCond = builder.NewCond()