Files
Umbraco-CMS/src/Umbraco.Cms.Api.Management/Controllers/Media/RecycleBin/SiblingsMediaRecycleBinController.cs
T
8213da1b77 Trees: Expanding sibling endpoints to include all entities with trees (#20150)
* Adding member types sibling endpoints

* Introducing sibling endpoint for Partial Views and logic.

* Introducing sibling endpoint for stylesheets

* Introducing sibling endpoint for scripts

* Introducing FileSystemTreeServiceBase.cs

* Introducing interfaces for implementation specific services

* Introducing services for specific trees

* Modifying controller bases to fit new interface and logic.

* Obsoleting old constructors related to PartialView

* Obsoleting ctors related to Stylesheets

* Obsoleting ctors related to scripts

* Adding tests for scriptsTreeService

* Adding tests for siblings

* Removing unused dependencies

* Removing signs and replacing it with flags

* Fixing breaking changes by obsoletion

* Fixing more breaking changes

* Registering missing service

* Fixing breaking changes again

* Changing name of method GetSiblingsViewModels

* Rewritten tests for less bloat and less duplicate code

* Expanding tests to include other methods from service

* Test refactoring: avoided populating file systems that weren't under test, updated encapsulation, renaming, further re-use.

* Management API: Expanding the existing sibling endpoints to support trashed entities (#20154)

* Refactoring existing logic to include trashed items

* Including tests for trashed entities

* Groundwork for trashed siblings

* Documents trashed siblings endpoint

* Controller for Media trashed items

* Expanding tests to include a test for trashed siblings

* Code review corrections

* Resolving code review

---------

Co-authored-by: Andy Butland <abutland73@gmail.com>
2025-09-23 11:17:25 +02:00

25 lines
1.0 KiB
C#

using Asp.Versioning;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Cms.Api.Common.ViewModels.Pagination;
using Umbraco.Cms.Api.Management.Factories;
using Umbraco.Cms.Api.Management.ViewModels.Media.RecycleBin;
using Umbraco.Cms.Core.Services;
namespace Umbraco.Cms.Api.Management.Controllers.Media.RecycleBin;
[ApiVersion("1.0")]
public class SiblingsMediaRecycleBinController : MediaRecycleBinControllerBase
{
public SiblingsMediaRecycleBinController(IEntityService entityService, IMediaPresentationFactory mediaPresentationFactory)
: base(entityService, mediaPresentationFactory)
{
}
[HttpGet("siblings")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(SubsetViewModel<MediaRecycleBinItemResponseModel>), StatusCodes.Status200OK)]
public async Task<ActionResult<SubsetViewModel<MediaRecycleBinItemResponseModel>>> Siblings(CancellationToken cancellationToken, Guid target, int before, int after, Guid? dataTypeId = null)
=> await GetSiblings(target, before, after);
}