From e4dbf4ce9ff9ca70ed7c82c0c735a4d576aad692 Mon Sep 17 00:00:00 2001 From: Matthew Wise <6782865+Matthew-Wise@users.noreply.github.com> Date: Sat, 12 Oct 2024 16:59:02 +0100 Subject: [PATCH] fix(#17220): added a sort to the mapping so the UI reflects the database --- .../Mapping/DocumentType/DocumentTypeMapDefinition.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Cms.Api.Management/Mapping/DocumentType/DocumentTypeMapDefinition.cs b/src/Umbraco.Cms.Api.Management/Mapping/DocumentType/DocumentTypeMapDefinition.cs index 2a5ea3ae7cc9..958dff64e424 100644 --- a/src/Umbraco.Cms.Api.Management/Mapping/DocumentType/DocumentTypeMapDefinition.cs +++ b/src/Umbraco.Cms.Api.Management/Mapping/DocumentType/DocumentTypeMapDefinition.cs @@ -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; @@ -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(); target.Compositions = MapNestedCompositions( source.ContentTypeComposition,