Skip to content

Commit

Permalink
Update internal/sdk/cloudian/sdk.go
Browse files Browse the repository at this point in the history
fix: handle users errors logic

Co-authored-by: Amund Tenstad <[email protected]>
  • Loading branch information
mariatsji and tenstad authored Nov 22, 2024
1 parent b93b115 commit fbf08f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/sdk/cloudian/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,11 @@ func (client Client) DeleteUser(user User) error {
// Delete a group and all its members
func (client Client) DeleteGroupRecursive(groupId string) error {
users, err := client.ListUsers(groupId, nil)

if err != nil {
for _, user := range users {
return err
}

for _, user := range users {
err := client.DeleteUser(user)
if err != nil {
return fmt.Errorf("Error deleting user: %w", err)
Expand Down

0 comments on commit fbf08f7

Please sign in to comment.