Skip to content

Commit

Permalink
Add mappings for updating userDefinedMetadata and metadata on data el…
Browse files Browse the repository at this point in the history
…ement (#108)

* Add mappings for updating userDefinedMetadata and metadata on data element.

* Use same storage and models versions as app-lib currently does.
  • Loading branch information
bjorntore authored Sep 10, 2024
1 parent 7a50cca commit 9646e12
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/Controllers/Storage/DataController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@ public async Task<ActionResult<DataElement>> Update(
{ "/refs", dataElement.Refs },
{ "/references", dataElement.References },
{ "/tags", dataElement.Tags },
{ "/userDefinedMetadata", dataElement.UserDefinedMetadata },
{ "/metadata", dataElement.Metadata },
{ "/deleteStatus", dataElement.DeleteStatus },
{ "/lastChanged", dataElement.LastChanged },
{ "/lastChangedBy", dataElement.LastChangedBy }
Expand Down
4 changes: 2 additions & 2 deletions src/LocalTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<ItemGroup>
<PackageReference Include="Altinn.Authorization.ABAC" Version="0.0.8" />
<PackageReference Include="Altinn.Common.PEP" Version="3.0.0" />
<PackageReference Include="Altinn.Platform.Models" Version="1.4.0" />
<PackageReference Include="Altinn.Platform.Storage.Interface" Version="3.25.0" />
<PackageReference Include="Altinn.Platform.Models" Version="1.6.1" />
<PackageReference Include="Altinn.Platform.Storage.Interface" Version="3.30.0" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
<PackageReference Include="FluentValidation" Version="11.8.0" />
<PackageReference Include="JWTCookieAuthentication" Version="2.4.2" />
Expand Down
12 changes: 10 additions & 2 deletions src/Services/Storage/Implementation/DataRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,16 @@ public async Task<DataElement> Update(Guid instanceGuid, Guid dataElementId, Dic
dataElement.Tags = (List<string>)property.Value;
break;
}
default:
break;
case "userDefinedMetadata":
{
dataElement.UserDefinedMetadata = (List<KeyValueEntry>)property.Value;
break;
}
case "metadata":
{
dataElement.Metadata = (List<KeyValueEntry>)property.Value;
break;
}
}
}
await Update(dataElement);
Expand Down

0 comments on commit 9646e12

Please sign in to comment.