From 0a06e5a2460b6327d18d88645e3684c28025efc5 Mon Sep 17 00:00:00 2001 From: kolaente Date: Mon, 17 Sep 2018 19:45:18 +0200 Subject: [PATCH] /lists/{listID}/teams now also returns the user right --- models/team_list.go | 5 +++++ models/team_list_readall.go | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/models/team_list.go b/models/team_list.go index 85b512db..8d3c4ca3 100644 --- a/models/team_list.go +++ b/models/team_list.go @@ -18,3 +18,8 @@ type TeamList struct { func (TeamList) TableName() string { return "team_list" } + +type teamWithRight struct { + Team `xorm:"extends"` + Right TeamRight `json:"right"` +} \ No newline at end of file diff --git a/models/team_list_readall.go b/models/team_list_readall.go index abbca4b5..e68f1b12 100644 --- a/models/team_list_readall.go +++ b/models/team_list_readall.go @@ -12,9 +12,8 @@ func (tl *TeamList) ReadAll(user *User) (interface{}, error) { } // Get the teams - all := []*Team{} - - err = x.Select("teams.*"). + all := []*teamWithRight{} + err = x. Table("teams"). Join("INNER", "team_list", "team_id = teams.id"). Where("team_list.list_id = ?", tl.ListID).