Skip to content

Commit

Permalink
fix condition (#37)
Browse files Browse the repository at this point in the history
Co-authored-by: Dean Oren <[email protected]>
  • Loading branch information
do87 and Dean Oren authored Oct 28, 2022
1 parent a03a9e9 commit 7d14f41
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pkg/api/v2/membership/members/members.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ type MembersService common.Service

// Member struct represents a single member
type Member struct {
Subject string `json:"subject"`
Role string `json:"role"`
Condition struct {
ExpiresAt string `json:"expiresAt"`
} `json:"condition,omitempty"`
Subject string `json:"subject"`
Role string `json:"role"`
Condition *Condition `json:"condition,omitempty"`
}

// Condition struct for memeber
type Condition struct {
ExpiresAt string `json:"expiresAt"`
}

// ResourceMembers struct represents member in a resource
Expand Down Expand Up @@ -95,7 +98,7 @@ func (svc *MembersService) Add(ctx context.Context, resourceID, resourceType str

params := url.Values{}
params.Add("resourceType", resourceType)
req, err := svc.Client.Request(ctx, http.MethodPatch, fmt.Sprintf(apiPath+"?"+params.Encode(), resourceID), body)
req, err := svc.Client.Request(ctx, http.MethodPatch, fmt.Sprintf(apiPath, resourceID), body)
if err != nil {
return
}
Expand Down

0 comments on commit 7d14f41

Please sign in to comment.