Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
arslanbekov committed Dec 21, 2022
1 parent e2aa526 commit e50ed41
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/teammate.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ func (c *Client) GetUsernameByEmail(ctx context.Context, email string) (string,
return "", err
}

users := []User{}
users := &Users{}

decoder := json.NewDecoder(bytes.NewReader([]byte(respBody)))
err = decoder.Decode(&users)
err = decoder.Decode(users)
if err != nil {
return "", err
}

for _, user := range users {
for _, user := range users.Result {
if user.Email == email && user.Username != "" {
return user.Username, nil
}
Expand Down

0 comments on commit e50ed41

Please sign in to comment.