Skip to content

Commit

Permalink
chore: Rename UpdateInsOrgRoleParams to UpdateInstanceOrganizationRol…
Browse files Browse the repository at this point in the history
…eParams

In the previous commit we missed to rename the struct we are using
to update an instance organization role as well
  • Loading branch information
chanioxaris committed Nov 13, 2023
1 parent 5f1f259 commit 92fa766
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions clerk/instance_organization_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ func (s *InstanceService) ReadOrganizationRole(orgRoleID string) (*Role, error)
return &orgRole, nil
}

type UpdateInsOrgRoleParams struct {
type UpdateInstanceOrganizationRoleParams struct {
Name *string `json:"name,omitempty"`
Key *string `json:"key,omitempty"`
Description *string `json:"description,omitempty"`
Permissions *[]string `json:"permissions,omitempty"`
}

func (s *InstanceService) UpdateOrganizationRole(orgRoleID string, params UpdateInsOrgRoleParams) (*Role, error) {
func (s *InstanceService) UpdateOrganizationRole(orgRoleID string, params UpdateInstanceOrganizationRoleParams) (*Role, error) {
req, _ := s.client.NewRequest(http.MethodPatch, fmt.Sprintf("%s/%s", OrganizationRolesUrl, orgRoleID), &params)

var orgRole Role
Expand Down
4 changes: 2 additions & 2 deletions clerk/instance_organization_roles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestOrganizationRolesService_Read(t *testing.T) {
func TestOrganizationRolesService_Update(t *testing.T) {
client, mux, _, teardown := setup("token")
defer teardown()
var payload UpdateInsOrgRoleParams
var payload UpdateInstanceOrganizationRoleParams
_ = json.Unmarshal([]byte(dummyUpdateOrgRoleJson), &payload)

expectedResponse := dummyOrgRoleJson
Expand Down Expand Up @@ -103,7 +103,7 @@ func TestOrganizationRolesService_Update(t *testing.T) {

func TestOrganizationRolesService_Update_invalidServer(t *testing.T) {
client, _ := NewClient("token")
var payload UpdateInsOrgRoleParams
var payload UpdateInstanceOrganizationRoleParams
_ = json.Unmarshal([]byte(dummyUpdateOrgRoleJson), &payload)

_, err := client.Instances().UpdateOrganizationRole("someOrgRoleId", payload)
Expand Down

0 comments on commit 92fa766

Please sign in to comment.