Skip to content

Commit 9646e12

Browse files
authored
Add mappings for updating userDefinedMetadata and metadata on data element (#108)
* Add mappings for updating userDefinedMetadata and metadata on data element. * Use same storage and models versions as app-lib currently does.
1 parent 7a50cca commit 9646e12

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

src/Controllers/Storage/DataController.cs

+2
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,8 @@ public async Task<ActionResult<DataElement>> Update(
461461
{ "/refs", dataElement.Refs },
462462
{ "/references", dataElement.References },
463463
{ "/tags", dataElement.Tags },
464+
{ "/userDefinedMetadata", dataElement.UserDefinedMetadata },
465+
{ "/metadata", dataElement.Metadata },
464466
{ "/deleteStatus", dataElement.DeleteStatus },
465467
{ "/lastChanged", dataElement.LastChanged },
466468
{ "/lastChangedBy", dataElement.LastChangedBy }

src/LocalTest.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
<ItemGroup>
1313
<PackageReference Include="Altinn.Authorization.ABAC" Version="0.0.8" />
1414
<PackageReference Include="Altinn.Common.PEP" Version="3.0.0" />
15-
<PackageReference Include="Altinn.Platform.Models" Version="1.4.0" />
16-
<PackageReference Include="Altinn.Platform.Storage.Interface" Version="3.25.0" />
15+
<PackageReference Include="Altinn.Platform.Models" Version="1.6.1" />
16+
<PackageReference Include="Altinn.Platform.Storage.Interface" Version="3.30.0" />
1717
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
1818
<PackageReference Include="FluentValidation" Version="11.8.0" />
1919
<PackageReference Include="JWTCookieAuthentication" Version="2.4.2" />

src/Services/Storage/Implementation/DataRepository.cs

+10-2
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,16 @@ public async Task<DataElement> Update(Guid instanceGuid, Guid dataElementId, Dic
167167
dataElement.Tags = (List<string>)property.Value;
168168
break;
169169
}
170-
default:
171-
break;
170+
case "userDefinedMetadata":
171+
{
172+
dataElement.UserDefinedMetadata = (List<KeyValueEntry>)property.Value;
173+
break;
174+
}
175+
case "metadata":
176+
{
177+
dataElement.Metadata = (List<KeyValueEntry>)property.Value;
178+
break;
179+
}
172180
}
173181
}
174182
await Update(dataElement);

0 commit comments

Comments
 (0)