Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental: return PUT response in Update instead of performing a GET #735

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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