From f11ffc11214b5b75cdc861aa4787951f1ce5544e Mon Sep 17 00:00:00 2001 From: Tomer Heber Date: Tue, 19 Nov 2024 16:34:09 -0600 Subject: [PATCH] update team get by name --- client/team.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/client/team.go b/client/team.go index f329303f..25c44b4a 100644 --- a/client/team.go +++ b/client/team.go @@ -94,5 +94,18 @@ func (client *ApiClient) Teams() ([]Team, error) { } func (client *ApiClient) TeamsByName(name string) ([]Team, error) { - return client.GetTeams(map[string]string{"name": name}) + organizationId, err := client.OrganizationId() + if err != nil { + return nil, err + } + + var result []Team + + if err := client.http.Get("/teams/organizations/"+organizationId, map[string]string{ + "name": name, + }, &result); err != nil { + return nil, err + } + + return result, nil }