Skip to content

Commit

Permalink
Experimental: return PUT response in Update instead of performing a GET
Browse files Browse the repository at this point in the history
  • Loading branch information
rosslovas committed Jul 17, 2023
1 parent 1e047d1 commit 6c9e45c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions source/Octopus.Server.Client/OctopusAsyncClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -527,10 +527,12 @@ public async Task<TResource> Update<TResource>(string path, TResource resource,
{
var uri = QualifyUri(path, pathParameters);
var response = await DispatchRequest<TResource>(new OctopusRequest("PUT", uri, requestResource: resource), true, cancellationToken).ConfigureAwait(false);
var getUrl = resourceSelfLinkExtractor.GetSelfUrlOrNull(response.ResponseResource) ?? path;
var result = await Get<TResource>(getUrl, null, cancellationToken).ConfigureAwait(false);

return result;
// var getUrl = resourceSelfLinkExtractor.GetSelfUrlOrNull(response.ResponseResource) ?? path;
// var result = await Get<TResource>(getUrl, null, cancellationToken).ConfigureAwait(false);

return response.ResponseResource;

// return result;
}

/// <inheritdoc />
Expand Down

0 comments on commit 6c9e45c

Please sign in to comment.