Skip to content

Commit

Permalink
Remove unused property on DataPatchResult (#852)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivarne authored Oct 22, 2024
1 parent 209f36f commit 06c39a4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
6 changes: 0 additions & 6 deletions src/Altinn.App.Core/Internal/Patch/DataPatchResult.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Altinn.App.Core.Features;
using Altinn.App.Core.Models;
using Altinn.App.Core.Models.Validation;
using Altinn.Platform.Storage.Interface.Models;
Expand All @@ -20,11 +19,6 @@ public class DataPatchResult
/// </summary>
public required List<ValidationSourcePair> ValidationIssues { get; init; }

/// <summary>
/// The current data model after the patch operation.
/// </summary>
public required List<DataElementChange> ChangedDataElements { get; init; }

/// <summary>
/// Get updated data elements that have app logic in a dictionary with the data element id as key.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion src/Altinn.App.Core/Internal/Patch/PatchService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ await RunDataProcessors(
return new DataPatchResult
{
Instance = instance,
ChangedDataElements = changes,
UpdatedData = updatedData,
ValidationIssues = validationIssues,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,13 @@ public async Task Test_Ok()
response.Ok.Should().NotBeNull();
var res = response.Ok!;
var change = res
.ChangedDataElements.Should()
.UpdatedData.Should()
.ContainSingle()
.Which.Should()
.BeOfType<DataElementChange>()
.BeOfType<DataPatchResult.DataModelPair>()
.Which;
change.DataElement.Id.Should().Be(_dataGuid.ToString());
change.CurrentFormData.Should().BeOfType<MyModel>().Subject.Name.Should().Be("Test Testesen");
change.Identifier.Id.Should().Be(_dataGuid.ToString());
change.Data.Should().BeOfType<MyModel>().Subject.Name.Should().Be("Test Testesen");
var validator = res.ValidationIssues.Should().ContainSingle().Which;
validator.Source.Should().Be("formDataValidator");
var issue = validator.Issues.Should().ContainSingle().Which;
Expand Down

0 comments on commit 06c39a4

Please sign in to comment.