Skip to content

Commit

Permalink
feat: change the schema (proposal)
Browse files Browse the repository at this point in the history
  • Loading branch information
amandahla committed Dec 12, 2024
1 parent c21ac36 commit 35e236a
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 225 deletions.
18 changes: 11 additions & 7 deletions internal/juju/offers.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ type RemoveRemoteOfferInput struct {
}

type GrantRevokeOfferInput struct {
User string
Users []string
Access string
OfferURL string
}
Expand Down Expand Up @@ -416,9 +416,11 @@ func (c offersClient) GrantOffer(input *GrantRevokeOfferInput) error {
return err
}

err = client.GrantOffer(input.User, input.Access, input.OfferURL)
if err != nil {
return err
for _, user := range input.Users {
err = client.GrantOffer(user, input.Access, input.OfferURL)
if err != nil {
return err
}
}

return nil
Expand All @@ -438,9 +440,11 @@ func (c offersClient) RevokeOffer(input *GrantRevokeOfferInput) error {
return err
}

err = client.RevokeOffer(input.User, input.Access, input.OfferURL)
if err != nil {
return err
for _, user := range input.Users {
err = client.RevokeOffer(user, input.Access, input.OfferURL)
if err != nil {
return err
}
}

return nil
Expand Down
Loading

0 comments on commit 35e236a

Please sign in to comment.