Try parse sku from input line on Rhsolutions function apply

This commit is contained in:
Sergey Chebotar 2022-12-22 16:00:38 +03:00
parent f267b27375
commit c47301c0db

View File

@ -17,9 +17,9 @@ namespace RhSolutions.Services
{ {
string request = string.Empty; string request = string.Empty;
if (line.IsRehauSku()) if (Sku.TryParse(line, out var skus))
{ {
request = @"https://rh.cebotari.ru/api/products/" + line; request = @"https://rh.cebotari.ru/api/products/" + skus.FirstOrDefault().ToString();
} }
else else
@ -42,14 +42,7 @@ namespace RhSolutions.Services
} }
else else
{ {
if (line.IsRehauSku()) return $"{product.ProductSku} {product.Name}";
{
return product.Name;
}
else
{
return $"{product.ProductSku} {product.Name}";
}
} }
} }
catch catch