1
0

Added tests for team <-> list relations

This commit is contained in:
konrad
2018-08-29 08:50:52 +02:00
committed by kolaente
parent 950533df21
commit 98e3d3e884
6 changed files with 99 additions and 13 deletions

View File

@ -60,16 +60,6 @@ type TeamUser struct {
Admin bool `json:"admin"`
}
// GetAllTeamsByNamespaceID returns all teams for a namespace
func GetAllTeamsByNamespaceID(id int64) (teams []*Team, err error) {
err = x.Table("teams").
Join("INNER", "team_namespaces", "teams.id = team_id").
Where("teams.namespace_id = ?", id).
Find(teams)
return
}
// GetTeamByID gets a team by its ID
func GetTeamByID(id int64) (team Team, err error) {
exists, err := x.Where("id = ?", id).Get(&team)