Skip to content

Commit

Permalink
chore: use clerk.JoinPath
Browse files Browse the repository at this point in the history
  • Loading branch information
kostaspt committed Nov 12, 2024
1 parent 1b64d7f commit e9158d5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions invitation/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,16 @@ func (b *bulkCreateResponse) UnmarshalJSON(data []byte) error {

// BulkCreate creates multiple invitations.
func (c *Client) BulkCreate(ctx context.Context, params *BulkCreateParams) (*clerk.Invitations, error) {
req := clerk.NewAPIRequest(http.MethodPost, fmt.Sprintf("%s/bulk", path))
path, err := clerk.JoinPath(path, "bulk")
if err != nil {
return nil, err
}

req := clerk.NewAPIRequest(http.MethodPost, path)
req.SetParams(params)

res := &bulkCreateResponse{}
err := c.Backend.Call(ctx, req, res)
if err != nil {
if err := c.Backend.Call(ctx, req, res); err != nil {
return nil, err
}

Expand Down

0 comments on commit e9158d5

Please sign in to comment.