code: func (hs *HTTPServer) UpdateTeamMember(c *m.ReqContext, cmd m.UpdateTeamMemberCommand) Response {
  	teamId := c.ParamsInt64(":teamId")
  	orgId := c.OrgId
  
  	if err := teamguardian.CanAdmin(hs.Bus, orgId, teamId, c.SignedInUser); err != nil {
  		return Error(403, "Not allowed to update team member", err)
  	}
  
  	if c.OrgRole != m.ROLE_ADMIN {
  		cmd.ProtectLastAdmin = true
  	}
  
  	cmd.TeamId = teamId
  	cmd.UserId = c.ParamsInt64(":userId")
  	cmd.OrgId = orgId
  
  	if err := hs.Bus.Dispatch(&cmd); err != nil {
  		if err == m.ErrTeamMemberNotFound {
  			return Error(404, "Team member not found.", nil)
  		}
  		return Error(500, "Failed to update team member.", err)
  	}
  	return Success("Team member updated")
  }
docs: // PUT /:teamId/members/:userId