Skip to content

Commit

Permalink
Merge pull request #476 from bcgov/yj
Browse files Browse the repository at this point in the history
chore: fix listing extract exception
  • Loading branch information
ychung-mot authored Jul 18, 2024
2 parents 2f18212 + 7103245 commit 862d204
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/StrDss.Data/Repositories/RentalListingRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,9 @@ private async Task LoadHistoryFields(RentalListingExportDto listing)
})
.ToListAsync();

var historyDict = listingHistory.ToDictionary(x => x.ReportPeriodYm);
var historyDict = listingHistory
.GroupBy(x => x.ReportPeriodYm)
.ToDictionary(g => g.Key, g => g.First()); // Use the first entry in case of duplicates

for (int i = 0; i < reportMonths.Length; i++)
{
Expand Down

0 comments on commit 862d204

Please sign in to comment.