Files
Umbraco-CMS/src/Umbraco.Cms.Api.Management/Extensions/ContentEditingExtensions.cs
Bjarke Berg 608f2e3c76 Scheduled publishing in Management API (#15680)
* Only use datetimeoffset in API

* Updated publish endpoint to take schedule information

* Fixed test builds

* OpenApi updates

* Update OpenApi schema

* Fixed issues with publishing.

* Added validation before publishing. Had to move a lot of classes to core.

* added missing files

* Added validation info to error

* Typo

* Clean up and adding missing result

* Updating to AvailableCultures instead of PublishedCultures

* Handle time needs to be in the future

* validate only cultures that needs to be published

* Fix typos

* Filter out cultures that we are not trying to publish from the validation errors

* Don't filter out only the available cultures, to accommodate non-created variants

* Only allow publish of existing cultures

* Fixed issues found in test

* fixed build

---------

Co-authored-by: Elitsa <elm@umbraco.dk>
2024-02-21 09:10:48 +01:00

19 lines
622 B
C#

using Umbraco.Cms.Core.Models.ContentEditing;
namespace Umbraco.Cms.Api.Management.Extensions;
internal static class ContentEditingExtensions
{
public static bool DoesNotVaryByCulture(this IHasCultureAndSegment model)
=> model.VariesByCulture() == false;
public static bool DoesNotVaryBySegment(this IHasCultureAndSegment model)
=> model.VariesBySegment() == false;
public static bool VariesByCulture(this IHasCultureAndSegment model)
=> model.Culture is not null;
public static bool VariesBySegment(this IHasCultureAndSegment model)
=> model.Segment is not null;
}