/lists/{listID}/teams now also returns the user right
This commit is contained in:
parent
cf6577445d
commit
0a06e5a246
2 changed files with 7 additions and 3 deletions
|
@ -18,3 +18,8 @@ type TeamList struct {
|
||||||
func (TeamList) TableName() string {
|
func (TeamList) TableName() string {
|
||||||
return "team_list"
|
return "team_list"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type teamWithRight struct {
|
||||||
|
Team `xorm:"extends"`
|
||||||
|
Right TeamRight `json:"right"`
|
||||||
|
}
|
|
@ -12,9 +12,8 @@ func (tl *TeamList) ReadAll(user *User) (interface{}, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the teams
|
// Get the teams
|
||||||
all := []*Team{}
|
all := []*teamWithRight{}
|
||||||
|
err = x.
|
||||||
err = x.Select("teams.*").
|
|
||||||
Table("teams").
|
Table("teams").
|
||||||
Join("INNER", "team_list", "team_id = teams.id").
|
Join("INNER", "team_list", "team_id = teams.id").
|
||||||
Where("team_list.list_id = ?", tl.ListID).
|
Where("team_list.list_id = ?", tl.ListID).
|
||||||
|
|
Loading…
Reference in a new issue