diff options
author | Jimmy Praet <jimmy.praet@telenet.be> | 2020-12-27 20:58:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-27 21:58:03 +0200 |
commit | 40274b4a935fff50e223751ce3653c2549352b10 (patch) | |
tree | a526f098018a04bbb12bccbebc6122ca209fa732 /models/repo_list.go | |
parent | 25f8970b2cc5d2c9fd357ef2c60a54886154f6c9 (diff) | |
download | gitea-40274b4a935fff50e223751ce3653c2549352b10.tar.gz gitea-40274b4a935fff50e223751ce3653c2549352b10.zip |
Team dashboards (#14159)
Diffstat (limited to 'models/repo_list.go')
-rw-r--r-- | models/repo_list.go | 5 |
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() |