my.json now contains team members, instead of teams.json

This commit is contained in:
nemunaire 2016-01-24 11:42:26 +01:00
commit e207e90c2e
2 changed files with 5 additions and 4 deletions

View file

@ -26,6 +26,7 @@ type myTeamExercice struct {
type myTeam struct {
Id int64 `json:"team_id"`
Points int64 `json:"score"`
Members []Member `json:"members"`
Exercices map[string]myTeamExercice `json:"exercices"`
}
@ -36,6 +37,10 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
} else {
ret.Id = t.Id
ret.Points, _ = t.GetPoints()
if members, err := t.GetMembers(); err == nil {
ret.Members = members
}
}
ret.Exercices = map[string]myTeamExercice{}