mirror of https://github.com/Squidex/squidex.git
committed by
GitHub
15 changed files with 276 additions and 157 deletions
@ -0,0 +1,13 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
namespace Squidex.Domain.Apps.Entities.Contents.Commands |
|||
{ |
|||
public sealed class ValidateContent : ContentCommand |
|||
{ |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
using Squidex.Infrastructure.Validation; |
|||
|
|||
namespace Squidex.Domain.Apps.Entities.Contents |
|||
{ |
|||
public sealed class ValidationResult |
|||
{ |
|||
public ValidationError[] Errors { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
// ==========================================================================
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex UG (haftungsbeschraenkt)
|
|||
// All rights reserved. Licensed under the MIT license.
|
|||
// ==========================================================================
|
|||
|
|||
using System.Linq; |
|||
using Squidex.Domain.Apps.Entities.Contents; |
|||
using Squidex.Web; |
|||
|
|||
namespace Squidex.Areas.Api.Controllers.Contents.Models |
|||
{ |
|||
public class ValidationResultDto |
|||
{ |
|||
/// <summary>
|
|||
/// The validation errors.
|
|||
/// </summary>
|
|||
public string[] Errors { get; set; } |
|||
|
|||
public static ValidationResultDto FromResult(ValidationResult result) |
|||
{ |
|||
return new ValidationResultDto |
|||
{ |
|||
Errors = ApiExceptionConverter.ToErrors(result.Errors).ToArray() |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue