Skip to content

Commit

Permalink
Merge pull request #796 from CareTogether/odata-improvements
Browse files Browse the repository at this point in the history
Better handling for null ages in OData
  • Loading branch information
LarsKemmann authored Nov 12, 2024
2 parents d912eb4 + 8823590 commit fcfad4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/CareTogether.Api/OData/LiveODataModelController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ private FamilyRecordsAggregate AnonymizeFamilyRecords(FamilyRecordsAggregate dat
{
AgeInYears age => new AgeInYears(age.Years, new DateTime(age.AsOf.Year, 1, 1)),
ExactAge age => new ExactAge(new DateTime(age.DateOfBirth.Year, 1, 1)),
_ => throw new NotImplementedException($"Unknown age type: {adult.Item1.Age?.GetType().Name}")
_ => null
},
Concerns = null,
EmailAddresses = adult.Item1.EmailAddresses.Select((email, e) => email with
Expand Down Expand Up @@ -435,7 +435,7 @@ private FamilyRecordsAggregate AnonymizeFamilyRecords(FamilyRecordsAggregate dat
{
AgeInYears age => new AgeInYears(age.Years, new DateTime(age.AsOf.Year, 1, 1)),
ExactAge age => new ExactAge(new DateTime(age.DateOfBirth.Year, 1, 1)),
_ => throw new NotImplementedException($"Unknown age type: {child.Age?.GetType().Name}")
_ => null
},
Concerns = null,
EmailAddresses = child.EmailAddresses.Select((email, e) => email with
Expand Down

0 comments on commit fcfad4a

Please sign in to comment.