aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2022-12-26 14:46:37 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2022-12-26 14:46:37 +0300
commit6ac7b98e592f2e24bd135538582dd6053ee1eb64 (patch)
tree37babde05727196f5bfd11d812eeb707c2c92456 /src
parent755d556f097789f662c43902f5fb59d40138a6f8 (diff)
RhDatabaseClient refactoring
Diffstat (limited to 'src')
-rw-r--r--src/Services/RhDatabaseClient.cs7
1 files changed, 2 insertions, 5 deletions
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<object> 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