forked from forgejo/forgejo
Clean oauth code
This commit is contained in:
parent
8c266f2df5
commit
4b9b8024ba
17 changed files with 547 additions and 748 deletions
|
@ -714,9 +714,14 @@ func GetRepositoryById(id int64) (*Repository, error) {
|
|||
}
|
||||
|
||||
// GetRepositories returns the list of repositories of given user.
|
||||
func GetRepositories(user *User) ([]Repository, error) {
|
||||
func GetRepositories(user *User, private bool) ([]Repository, error) {
|
||||
repos := make([]Repository, 0, 10)
|
||||
err := orm.Desc("updated").Find(&repos, &Repository{OwnerId: user.Id})
|
||||
sess := orm.Desc("updated")
|
||||
if !private {
|
||||
sess.Where("is_private=?", false)
|
||||
}
|
||||
|
||||
err := sess.Find(&repos, &Repository{OwnerId: user.Id})
|
||||
return repos, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue