Skip to content

Commit

Permalink
Fix - Correction de la recherche de tag pour l'import de produits
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmugnier committed Nov 5, 2020
1 parent 90242f1 commit 491ef8f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ private async Task<Result<CreateProductCommand>> CreateProductCommandFromRowData
var conditioningStr = worksheet.Cells[i, 5].GetValue<string>()?.ToLowerInvariant().Replace("\"", "").Replace("'", "").Replace(".", ",").Split(",").Select(t => t.Trim()).FirstOrDefault();
var quantityPerUnitStr = worksheet.Cells[i, 6].GetValue<string>()?.ToLowerInvariant().Replace(" ", "").Replace(",", ".");
var unitKindStr = worksheet.Cells[i, 7].GetValue<string>()?.ToLowerInvariant().Replace(" ", "").Replace(",", ".").Split(",").Select(t => t.Trim()).FirstOrDefault();
var tagsStr = worksheet.Cells[i, 8].GetValue<string>()?.ToLowerInvariant().Replace("\"", "").Replace("'", "").Replace(".", ",").Split(",").Select(t => t.Trim()).FirstOrDefault();
var tagsStr = worksheet.Cells[i, 8].GetValue<string>()?.Replace("\"", "").Replace("'", "").Replace(".", ",").Split(",").Select(t => t.Trim()).FirstOrDefault();
var bioStr = worksheet.Cells[i, 9].GetValue<string>()?.ToLowerInvariant().Replace(" ", "");

if (!decimal.TryParse(wholeSalePriceStr, NumberStyles.Any, new CultureInfo("en-US"), out decimal wholeSalePrice))
Expand Down Expand Up @@ -420,7 +420,7 @@ private async Task<Result<CreateProductCommand>> CreateProductCommandFromRowData

var tagsAsStr = tagsStr.Split(";").ToList();

var tags = await _context.FindAsync<Tag>(t => tagsAsStr.Any(c => c == t.Name.ToLowerInvariant()), token);
var tags = await _context.FindAsync<Tag>(t => tagsAsStr.Contains(t.Name), token);
createProductCommand.Tags = tags.Select(t => t.Id);

createProductCommand.Available = false;
Expand Down

0 comments on commit 491ef8f

Please sign in to comment.