Skip to content

Commit

Permalink
Worked on #475.
Browse files Browse the repository at this point in the history
  • Loading branch information
uncheckederror committed Nov 6, 2024
1 parent f87ac05 commit 705177b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
5 changes: 1 addition & 4 deletions NumberSearch.Ingest/Owned.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using FirstCom;
using FirstCom.Models;
using FirstCom.Models;

using Flurl.Http;

Expand All @@ -11,8 +10,6 @@

using Serilog;

using ServiceReference;

using System;
using System.Collections.Generic;
using System.Linq;
Expand Down
11 changes: 10 additions & 1 deletion NumberSearch.Ops/Models/Cart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,16 @@ public Dictionary<string, ProductOrder> ProductOrdersToDictionary()

if (!string.IsNullOrWhiteSpace(foreignId))
{
dict.Add(foreignId, item);
var checkDuplicate = dict.TryGetValue(foreignId, out var value);
if (checkDuplicate && value is not null)
{
// Merge the quantities.
value.Quantity += item.Quantity;
}
else
{
dict.Add(foreignId, item);
}
}
}

Expand Down

0 comments on commit 705177b

Please sign in to comment.