Skip to content

Commit

Permalink
resolved bug in create member
Browse files Browse the repository at this point in the history
  • Loading branch information
Kdheeru12 committed Dec 1, 2021
1 parent 5f7b2c5 commit c4f7bbb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/members.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,28 @@ type MemberResponse struct {
Role int `json:"role"`
}

func (c *MemberService) CreateTeamMember(team string, member *Member) (*MemberResponse, error) {
func (c *MemberService) CreateTeamMember(team string, member *Member) (*Member, error) {
path := fmt.Sprintf("/api/account/teams/%s/members/", team)

body, err := c.client.newRequestDo("POST", path, member)
if err != nil {
return nil, err
}
var s MemberResponse
var s Member
err = json.Unmarshal(body.BodyBytes, &s)
if err != nil {
return nil, err
}
return &s, nil
}

func (c *MemberService) UpdateTeamMember(member *Member) (*MemberResponse, error) {
func (c *MemberService) UpdateTeamMember(member *Member) (*Member, error) {
path := fmt.Sprintf("/api/account/teams/%s/members/%s/", member.Team, member.Unique_Id)
body, err := c.client.newRequestDo("PATCH", path, member)
if err != nil {
return nil, err
}
var s MemberResponse
var s Member
err = json.Unmarshal(body.BodyBytes, &s)
if err != nil {
return nil, err
Expand Down

0 comments on commit c4f7bbb

Please sign in to comment.