Skip to content

Commit

Permalink
fix(#17220): added a sort to the mapping so the UI reflects the database
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew-Wise authored and nul800sebastiaan committed Oct 12, 2024
1 parent dabaeac commit e4dbf4c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Umbraco.Cms.Api.Management.Mapping.ContentType;
using Umbraco.Cms.Api.Management.Mapping.ContentType;
using Umbraco.Cms.Api.Management.ViewModels;
using Umbraco.Cms.Api.Management.ViewModels.DocumentType;
using Umbraco.Cms.Core.Mapping;
Expand Down Expand Up @@ -39,6 +39,7 @@ private void Map(IContentType source, DocumentTypeResponseModel target, MapperCo
target.Properties = MapPropertyTypes(source);
target.AllowedDocumentTypes = source.AllowedContentTypes?.Select(ct =>
new DocumentTypeSort { DocumentType = new ReferenceByIdModel(ct.Key), SortOrder = ct.SortOrder })
.OrderBy(ct => ct.SortOrder)
.ToArray() ?? Enumerable.Empty<DocumentTypeSort>();
target.Compositions = MapNestedCompositions(
source.ContentTypeComposition,
Expand Down

0 comments on commit e4dbf4c

Please sign in to comment.