diff --git a/houston/queries.go b/houston/queries.go index f6edf4226..bd980ba42 100644 --- a/houston/queries.go +++ b/houston/queries.go @@ -526,8 +526,8 @@ mutation UpdateDeployment($deploymentId: Uuid!, $payload: JSON!, $executor: Exec }` WorkspaceUserUpdateRequest = ` - mutation workspaceUpdateUserRole($workspaceUuid: Uuid!, $email: String!, $role: Role!) { - workspaceUpdateUserRole( + mutation workspaceUpsertUserRole($workspaceUuid: Uuid!, $email: String!, $role: Role!) { + workspaceUpsertUserRole( workspaceUuid: $workspaceUuid email: $email role: $role diff --git a/houston/types.go b/houston/types.go index 4777fb591..9ea3d16bd 100644 --- a/houston/types.go +++ b/houston/types.go @@ -44,7 +44,7 @@ type ResponseData struct { CancelUpdateDeploymentRuntime *Deployment `json:"cancelRuntimeUpdate,omitempty"` UpdateWorkspace *Workspace `json:"updateWorkspace,omitempty"` DeploymentLog []DeploymentLog `json:"logs,omitempty"` - WorkspaceUpdateUserRole string `json:"workspaceUpdateUserRole,omitempty"` + WorkspaceUpsertUserRole string `json:"workspaceUpsertUserRole,omitempty"` WorkspaceGetUser WorkspaceUserRoleBindings `json:"workspaceUser,omitempty"` WorkspaceGetUsers []WorkspaceUserRoleBindings `json:"workspaceUsers,omitempty"` DeploymentConfig DeploymentConfig `json:"deploymentConfig,omitempty"` diff --git a/houston/workspace_users.go b/houston/workspace_users.go index bfeb3b68d..2e440f5b1 100644 --- a/houston/workspace_users.go +++ b/houston/workspace_users.go @@ -57,7 +57,7 @@ func (h ClientImplementation) UpdateWorkspaceUserRole(workspaceID, email, role s return "", handleAPIErr(err) } - return r.Data.WorkspaceUpdateUserRole, nil + return r.Data.WorkspaceUpsertUserRole, nil } // GetUserRoleInWorkspace - get a user role in a workspace diff --git a/houston/workspace_users_test.go b/houston/workspace_users_test.go index ce8afbebc..6df66f6b5 100644 --- a/houston/workspace_users_test.go +++ b/houston/workspace_users_test.go @@ -181,7 +181,7 @@ func TestUpdateWorkspaceUserAndRole(t *testing.T) { mockResponse := &Response{ Data: ResponseData{ - WorkspaceUpdateUserRole: DeploymentAdminRole, + WorkspaceUpsertUserRole: DeploymentAdminRole, }, } jsonResponse, err := json.Marshal(mockResponse) @@ -199,7 +199,7 @@ func TestUpdateWorkspaceUserAndRole(t *testing.T) { response, err := api.UpdateWorkspaceUserRole("workspace-id", "email", DeploymentAdminRole) assert.NoError(t, err) - assert.Equal(t, response, mockResponse.Data.WorkspaceUpdateUserRole) + assert.Equal(t, response, mockResponse.Data.WorkspaceUpsertUserRole) }) t.Run("error", func(t *testing.T) {