From 1e59041667340093fe50da32a3154bdfa2fd3ee8 Mon Sep 17 00:00:00 2001 From: Mole Date: Tue, 12 Mar 2024 10:40:48 +0100 Subject: [PATCH] Expose default listview ids in datatype configuration endpoint (#15865) --- .../DataType/ConfigurationDataTypeController.cs | 6 +++++- .../DataType/DatatypeConfigurationResponseModel.cs | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Cms.Api.Management/Controllers/DataType/ConfigurationDataTypeController.cs b/src/Umbraco.Cms.Api.Management/Controllers/DataType/ConfigurationDataTypeController.cs index 7a939a474c..fb6c4f871a 100644 --- a/src/Umbraco.Cms.Api.Management/Controllers/DataType/ConfigurationDataTypeController.cs +++ b/src/Umbraco.Cms.Api.Management/Controllers/DataType/ConfigurationDataTypeController.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; using Umbraco.Cms.Api.Management.ViewModels.DataType; +using Umbraco.Cms.Core; using Umbraco.Cms.Core.Configuration.Models; namespace Umbraco.Cms.Api.Management.Controllers.DataType; @@ -22,7 +23,10 @@ public class ConfigurationDataTypeController : DataTypeControllerBase var responseModel = new DatatypeConfigurationResponseModel { CanBeChanged = _dataTypesSettings.CanBeChanged, + DocumentListViewId = Constants.DataTypes.Guids.ListViewContentGuid, + MediaListViewId = Constants.DataTypes.Guids.ListViewMediaGuid, + MemberListViewId = Constants.DataTypes.Guids.ListViewMembersGuid, }; - return Task.FromResult(Ok()); + return Task.FromResult(Ok(responseModel)); } } diff --git a/src/Umbraco.Cms.Api.Management/ViewModels/DataType/DatatypeConfigurationResponseModel.cs b/src/Umbraco.Cms.Api.Management/ViewModels/DataType/DatatypeConfigurationResponseModel.cs index 7a43a50575..cf8cc2ef58 100644 --- a/src/Umbraco.Cms.Api.Management/ViewModels/DataType/DatatypeConfigurationResponseModel.cs +++ b/src/Umbraco.Cms.Api.Management/ViewModels/DataType/DatatypeConfigurationResponseModel.cs @@ -4,5 +4,11 @@ namespace Umbraco.Cms.Api.Management.ViewModels.DataType; public class DatatypeConfigurationResponseModel { - public required DataTypeChangeMode CanBeChanged { get; set; } + public required DataTypeChangeMode CanBeChanged { get; init; } + + public required Guid DocumentListViewId { get; init; } + + public required Guid MediaListViewId { get; init; } + + public required Guid MemberListViewId { get; init; } }