Skip to content

Commit

Permalink
test(e2e): fix search bot project
Browse files Browse the repository at this point in the history
Signed-off-by: JobaDiniz <[email protected]>
  • Loading branch information
JobaDiniz committed Aug 19, 2023
1 parent 35303cf commit a8d1763
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Joba.IBM.RPA.Cli/Client/RpaClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,23 +330,23 @@ public async Task CreateOrUpdateAsync(CreateBotRequest bot, CancellationToken ca

private async Task<BotSearchResponse> UpdateAsync(Guid id, CreateBotRequest bot, CancellationToken cancellation)
{
var url = $"{CultureInfo.CurrentCulture.Name}/project/bot/{id}";
var url = $"{CultureInfo.CurrentCulture.Name}/project/{bot.ProjectId}/bot/{id}";
var response = await client.PutAsJsonAsync(url, bot, SerializerOptions, cancellation);
await response.ThrowWhenUnsuccessfulAsync(cancellation);
return await response.Content.ReadFromJsonAsync<BotSearchResponse>(SerializerOptions, cancellation) ?? throw new Exception("Could not convert the response");
}

private async Task<BotSearchResponse> CreateAsync(CreateBotRequest bot, CancellationToken cancellation)
{
var url = $"{CultureInfo.CurrentCulture.Name}/project/bot";
var url = $"{CultureInfo.CurrentCulture.Name}/project/{bot.ProjectId}/bot";
var response = await client.PostAsJsonAsync(url, bot, SerializerOptions, cancellation);
await response.ThrowWhenUnsuccessfulAsync(cancellation);
return await response.Content.ReadFromJsonAsync<BotSearchResponse>(SerializerOptions, cancellation) ?? throw new Exception("Could not convert the response");
}

private async Task<IEnumerable<BotSearchResponse>> SearchAsync(Guid projectId, string name, int limit, CancellationToken cancellation)
{
var url = $"{CultureInfo.CurrentCulture.Name}/project/{projectId}/bot?include=ScriptVersion&offset=0&limit={limit}&search={name}&orderBy=name&asc=true";
var url = $"{CultureInfo.CurrentCulture.Name}/project/{projectId}/bot?offset=0&limit={limit}&search={name}&orderBy=name&asc=true";
var response = await client.GetFromJsonAsync<PagedResponse<BotSearchResponse>>(url, SerializerOptions, cancellation);
return response.Results;
}
Expand Down

0 comments on commit a8d1763

Please sign in to comment.