Skip to content

Commit

Permalink
Merge pull request #14 from enterspeedhq/feature/sc-2579/cli-fix-urls…
Browse files Browse the repository at this point in the history
…-for-update-and-delete-environment

Fixed ulr for update and delete environment clients
  • Loading branch information
jesperweber authored Feb 13, 2023
2 parents 91506a4 + 8cd384f commit 58be77c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public async Task<DeleteEnvironmentClientResponse> Handle(DeleteEnvironmentClien
{
var request =
new RestRequest(
$"tenant/environment-clients/{deleteEnvironmentClientRequest.EnvironmentClientId.EnvironmentGuid}/{deleteEnvironmentClientRequest.EnvironmentClientId.ClientGuid}/",
$"tenant/environments/{deleteEnvironmentClientRequest.EnvironmentClientId.EnvironmentGuid}/clients/{deleteEnvironmentClientRequest.EnvironmentClientId.ClientGuid}",
Method.Delete);

var response = await _enterspeedClient.ExecuteAsync<DeleteEnvironmentClientResponse>(request, cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public UpdateEnvironmentClientRequestRequestHandler(IEnterspeedClient enterspeed

public async Task<UpdateEnvironmentClientResponse> Handle(UpdateEnvironmentClientRequest updateEnvironmentClientRequest, CancellationToken cancellationToken)
{
var request = new RestRequest($"tenant/environment-clients/{updateEnvironmentClientRequest.EnvironmentClientId.EnvironmentGuid}/{updateEnvironmentClientRequest.EnvironmentClientId.ClientGuid}/", Method.Put)
var request = new RestRequest($"tenant/environments/{updateEnvironmentClientRequest.EnvironmentClientId.EnvironmentGuid}/clients/{updateEnvironmentClientRequest.EnvironmentClientId.ClientGuid}", Method.Put)
.AddJsonBody(updateEnvironmentClientRequest);

var response = await _enterspeedClient.ExecuteAsync<UpdateEnvironmentClientResponse>(request, cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,10 @@ public async Task<int> InvokeAsync(InvocationContext context)
return 1;
}

var updateRequest = new UpdateEnvironmentClientRequest(client.Id);

if (!string.IsNullOrEmpty(NewName))
var updateRequest = new UpdateEnvironmentClientRequest(client.Id)
{
updateRequest.Name = NewName;
}
Name = !string.IsNullOrEmpty(NewName) ? NewName : Name
};

if (!string.IsNullOrEmpty(Domains))
{
Expand Down

0 comments on commit 58be77c

Please sign in to comment.