mirror of https://github.com/Squidex/squidex.git
12 changed files with 213 additions and 24 deletions
@ -0,0 +1,19 @@ |
|||
// ==========================================================================
|
|||
// SchemaFieldsReordered.cs
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex Group
|
|||
// All rights reserved.
|
|||
// ==========================================================================
|
|||
|
|||
using System.Collections.Generic; |
|||
using Squidex.Infrastructure; |
|||
|
|||
namespace Squidex.Events.Schemas |
|||
{ |
|||
[TypeName("SchemaFieldsReorderedEvent")] |
|||
public class SchemaFieldsReordered : SchemaEvent |
|||
{ |
|||
public List<long> FieldIds { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
// ==========================================================================
|
|||
// ReorderFields.cs
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex Group
|
|||
// All rights reserved.
|
|||
// ==========================================================================
|
|||
|
|||
using System.Collections.Generic; |
|||
using Squidex.Infrastructure; |
|||
|
|||
namespace Squidex.Write.Schemas.Commands |
|||
{ |
|||
public class ReorderFields : SchemaAggregateCommand, IValidatable |
|||
{ |
|||
public List<long> FieldIds { get; set; } |
|||
|
|||
public void Validate(IList<ValidationError> errors) |
|||
{ |
|||
if (FieldIds == null) |
|||
{ |
|||
errors.Add(new ValidationError("Field ids must be specified", nameof(FieldIds))); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
// ==========================================================================
|
|||
// ReorderFieldsDto.cs
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex Group
|
|||
// All rights reserved.
|
|||
// ==========================================================================
|
|||
|
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Squidex.Controllers.Api.Schemas.Models |
|||
{ |
|||
public class ReorderFieldsDto |
|||
{ |
|||
/// <summary>
|
|||
/// The field ids in the target order.
|
|||
/// </summary>
|
|||
[Required] |
|||
public List<long> FieldIds { get; set; } |
|||
} |
|||
} |
|||
Loading…
Reference in new issue