Skip to content

Commit

Permalink
CR review
Browse files Browse the repository at this point in the history
  • Loading branch information
atainter committed Aug 28, 2024
1 parent a12857d commit 0e6824d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/fga/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import (
// ResponseLimit is the default number of records to limit a response to.
const ResponseLimit = 10

const (
SchemaConvertEndpoint = "%s/fga/v1/schemas/convert"
)

// Order represents the order of records.
type Order string

Expand Down Expand Up @@ -964,7 +968,7 @@ func (c *Client) Query(ctx context.Context, opts QueryOpts) (QueryResponse, erro
func (c *Client) ConvertSchemaToResourceTypes(ctx context.Context, opts ConvertSchemaToResourceTypesOpts) (ConvertSchemaResponse, error) {
c.once.Do(c.init)

endpoint := fmt.Sprintf("%s/fga/v1/schemas/convert", c.Endpoint)
endpoint := fmt.Sprintf(SchemaConvertEndpoint, c.Endpoint)
req, err := http.NewRequest(http.MethodPost, endpoint, strings.NewReader(opts.Schema))
if err != nil {
return ConvertSchemaResponse{}, err
Expand Down Expand Up @@ -1000,7 +1004,7 @@ func (c *Client) ConvertResourceTypesToSchema(ctx context.Context, opts ConvertR
return ConvertSchemaResponse{}, err
}

endpoint := fmt.Sprintf("%s/fga/v1/schemas/convert", c.Endpoint)
endpoint := fmt.Sprintf(SchemaConvertEndpoint, c.Endpoint)
req, err := http.NewRequest(http.MethodPost, endpoint, bytes.NewBuffer(data))
if err != nil {
return ConvertSchemaResponse{}, err
Expand Down

0 comments on commit 0e6824d

Please sign in to comment.