diff --git a/src/Services/RhDatabaseClient.cs b/src/Services/RhDatabaseClient.cs index bfa80ad..70530ae 100644 --- a/src/Services/RhDatabaseClient.cs +++ b/src/Services/RhDatabaseClient.cs @@ -11,11 +11,9 @@ namespace RhSolutions.Services { public static class RhDatabaseClient { - private static HttpClient httpClient = RhSolutionsAddIn.HttpClient; - public static async Task GetProduct(string line) { - string request = string.Empty; + string request; if (Sku.TryParse(line, out var skus)) { @@ -27,7 +25,7 @@ namespace RhSolutions.Services request = @"https://rh.cebotari.ru/api/search?query=" + line; } - var response = await httpClient.GetAsync(request); + var response = await RhSolutionsAddIn.HttpClient.GetAsync(request); try { @@ -49,7 +47,6 @@ namespace RhSolutions.Services { return $"Ошибка сервера {response.StatusCode}"; } - } } } \ No newline at end of file