Skip to content

Commit b1bb55f

Browse files
committed
Fix return type of UpdateOrganizationMemberRoles
1 parent b27a5ed commit b1bb55f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

codersdk/users.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,17 @@ func (c *Client) UpdateUserRoles(ctx context.Context, userID uuid.UUID, req Upda
217217

218218
// UpdateOrganizationMemberRoles grants the userID the specified roles in an org.
219219
// Include ALL roles the user has.
220-
func (c *Client) UpdateOrganizationMemberRoles(ctx context.Context, organizationID, userID uuid.UUID, req UpdateRoles) (User, error) {
220+
func (c *Client) UpdateOrganizationMemberRoles(ctx context.Context, organizationID, userID uuid.UUID, req UpdateRoles) (OrganizationMember, error) {
221221
res, err := c.request(ctx, http.MethodPut, fmt.Sprintf("/api/v2/organizations/%s/members/%s/roles", organizationID, uuidOrMe(userID)), req)
222222
if err != nil {
223-
return User{}, err
223+
return OrganizationMember{}, err
224224
}
225225
defer res.Body.Close()
226226
if res.StatusCode != http.StatusOK {
227-
return User{}, readBodyAsError(res)
227+
return OrganizationMember{}, readBodyAsError(res)
228228
}
229-
var user User
230-
return user, json.NewDecoder(res.Body).Decode(&user)
229+
var member OrganizationMember
230+
return member, json.NewDecoder(res.Body).Decode(&member)
231231
}
232232

233233
// GetUserRoles returns all roles the user has

0 commit comments

Comments
 (0)