MM-16500: Adds ability to retrieve the total count of teams via the API. (#11325)

Этот коммит содержится в:
Martin Kraft
2019-06-24 17:05:34 -04:00
коммит произвёл Miguel de la Cruz
родитель 49d5037a89
Коммит c07b7046ca
6 изменённых файлов: 78 добавлений и 3 удалений

Просмотреть файл

@@ -62,6 +62,11 @@ type Invites struct {
Invites []map[string]string `json:"invites"`
}
type TeamsWithCount struct {
Teams []*Team `json:"teams"`
TotalCount int64 `json:"total_count"`
}
func InvitesFromJson(data io.Reader) *Invites {
var o *Invites
json.NewDecoder(data).Decode(&o)
@@ -108,6 +113,17 @@ func TeamListToJson(t []*Team) string {
return string(b)
}
func TeamsWithCountToJson(tlc *TeamsWithCount) []byte {
b, _ := json.Marshal(tlc)
return b
}
func TeamsWithCountFromJson(data io.Reader) *TeamsWithCount {
var twc *TeamsWithCount
json.NewDecoder(data).Decode(&twc)
return twc
}
func TeamListFromJson(data io.Reader) []*Team {
var teams []*Team
json.NewDecoder(data).Decode(&teams)