Skip to content

Commit

Permalink
Fixed ulr for update and delete environment clients
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperweber committed Feb 13, 2023
1 parent 91506a4 commit 8cd384f
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 8cd384f

Please sign in to comment.