Skip curl output when using automatic versioning and reading (#858)
This makes it so that the actual output is the update/delete. Fixes #856
This commit is contained in:
1 parent
31ece74a92
commit
9de928318d
29 files changed
+228
-49
No files matched your search
@@ -181,7 +181,7 @@ func (c *Client) Read(ctx context.Context, authMethodId string, opt ...Option) (
|
||||
req.URL.RawQuery = q.Encode()
|
||||
}
|
||||
|
||||
resp, err := c.client.Do(req)
|
||||
resp, err := c.client.Do(req, apiOpts...)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error performing client request during Read call: %w", err)
|
||||
}
|
||||
@@ -213,7 +213,7 @@ func (c *Client) Update(ctx context.Context, authMethodId string, version uint32
|
||||
if !opts.withAutomaticVersioning {
|
||||
return nil, errors.New("zero version number passed into Update request and automatic versioning not specified")
|
||||
}
|
||||
existingTarget, existingErr := c.Read(ctx, authMethodId, opt...)
|
||||
existingTarget, existingErr := c.Read(ctx, authMethodId, append([]Option{WithSkipCurlOutput(true)}, opt...)...)
|
||||
if existingErr != nil {
|
||||
if api.AsServerError(existingErr) != nil {
|
||||
return nil, fmt.Errorf("error from controller when performing initial check-and-set read: %w", existingErr)
|
||||
|
||||
Reference in new issue
Block a user