forked from Gitlink/gitea-1156
Remove unnecessary private functions
This commit is contained in:
parent
bead46363b
commit
fb1708e1af
|
@ -1030,7 +1030,9 @@ func RemoveOrgRepo(orgID, repoID int64) error {
|
||||||
return removeOrgRepo(x, orgID, repoID)
|
return removeOrgRepo(x, orgID, repoID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (org *User) getUserRepositories(userID int64) (err error) {
|
// GetUserRepositories gets all repositories of an organization,
|
||||||
|
// that the user with the given userID has access to.
|
||||||
|
func (org *User) GetUserRepositories(userID int64) (err error) {
|
||||||
teams := make([]*Team, 0, 10)
|
teams := make([]*Team, 0, 10)
|
||||||
if err := x.Cols("`team`.id").
|
if err := x.Cols("`team`.id").
|
||||||
Where("`team_user`.org_id=?", org.Id).
|
Where("`team_user`.org_id=?", org.Id).
|
||||||
|
@ -1068,13 +1070,9 @@ func (org *User) getUserRepositories(userID int64) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetUserRepositories gets all repositories of an organization,
|
// GetTeams returns all teams that belong to organization,
|
||||||
// that the user with the given userID has access to.
|
// and that the user has joined.
|
||||||
func (org *User) GetUserRepositories(userID int64) error {
|
func (org *User) GetUserTeams(userID int64) (err error) {
|
||||||
return org.getUserRepositories(userID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (org *User) getUserTeams(userID int64) (err error) {
|
|
||||||
if err := x.Cols("`team`.*").
|
if err := x.Cols("`team`.*").
|
||||||
Where("`team_user`.org_id=?", org.Id).
|
Where("`team_user`.org_id=?", org.Id).
|
||||||
And("`team_user`.uid=?", userID).
|
And("`team_user`.uid=?", userID).
|
||||||
|
@ -1087,9 +1085,3 @@ func (org *User) getUserTeams(userID int64) (err error) {
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTeams returns all teams that belong to organization,
|
|
||||||
// and that the user has joined.
|
|
||||||
func (org *User) GetUserTeams(userID int64) error {
|
|
||||||
return org.getUserTeams(userID)
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue