Skip to content

Commit

Permalink
remove a user based on email from config
Browse files Browse the repository at this point in the history
  • Loading branch information
zeucapua committed Sep 24, 2024
1 parent 74a6def commit 8660829
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/offboard/offboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package offboard
import (
"errors"
"fmt"
"slices"

"github.com/open-sauced/pizza-cli/v2/pkg/config"

Expand Down Expand Up @@ -69,6 +70,13 @@ func run(opts *Options) error {
for _, user := range opts.offboardingUsers {
// deletes if the user is a name (key)
delete(attributions, user)

// delete if the user is an email (value)
for k, v := range attributions {
if slices.Contains(v, user) {
delete(attributions, k)
}
}
}

fmt.Print(attributions)
Expand Down

0 comments on commit 8660829

Please sign in to comment.